Fix rest verbs

This commit is contained in:
Alex Holliday committed 2024-08-02 11:54:46 -07:00
1 parent b5e12dabc4
commit aed4881eac
4 files changed
+14 -20

No files matched your search

@@ -77,9 +77,9 @@ export const updateUptimeMonitor = createAsyncThunk(
name: monitor.name,
description: monitor.description,
interval: monitor.interval,
notifications: monitor.notifications
notifications: monitor.notifications,
};
const res = await axiosInstance.post(
const res = await axiosInstance.put(
`/monitors/edit/${monitor._id}`,
updatedFields,
{
@@ -104,16 +104,12 @@ export const deleteUptimeMonitor = createAsyncThunk(
async (data, thunkApi) => {
try {
const { authToken, monitor } = data;
const res = await axiosInstance.post(
`/monitors/delete/${monitor._id}`,
{},
{
headers: {
Authorization: `Bearer ${authToken}`,
"Content-Type": "application/json",
},
}
);
const res = await axiosInstance.delete(`/monitors/${monitor._id}`, {
headers: {
Authorization: `Bearer ${authToken}`,
"Content-Type": "application/json",
},
});
return res.data;
} catch (error) {
if (error.response && error.response.data) {