diff --git a/frontend/src/API.js b/frontend/src/API.js index 640bc10f..218fe7ce 100644 --- a/frontend/src/API.js +++ b/frontend/src/API.js @@ -396,6 +396,18 @@ class Api { async downtime (id) { return axios.get(`api/downtimes/${id}`).then((response) => response.data); } + + async downtime_create (data) { + return axios.post('/api/downtimes', data).then((response) => response.data); + } + + async downtime_update ({ id, data }) { + return axios.patch(`/api/downtimes/${id}`, data).then((response) => response.data); + } + + async downtime_delete (id) { + return axios.delete(`/api/downtimes/${id}`).then((response) => response.data); + } } const api = new Api(); export default api; diff --git a/frontend/src/components/Dashboard/DashboardDowntimes.vue b/frontend/src/components/Dashboard/DashboardDowntimes.vue index c75cebc9..46893ab8 100644 --- a/frontend/src/components/Dashboard/DashboardDowntimes.vue +++ b/frontend/src/components/Dashboard/DashboardDowntimes.vue @@ -36,7 +36,7 @@
- + - You currently don't have any services! + You currently don't have any downtimes for this services!
- - {{ downtime.service_id }} + {{ downtime.service.name }} @@ -93,22 +92,22 @@ v-if="$store.state.admin" :disabled="isLoading" class="btn btn-sm btn-outline-secondary" - @click.prevent="goto({path: `/dashboard/edit_service/${service.id}`, params: {service: service} })" + @click.prevent="goto(`/dashboard/edit_downtime/${downtime.id}`)" >