modify network request to allow updating

This commit is contained in:
Alex Holliday committed 2025-02-05 10:55:58 -08:00
1 parent 76b21f1d8c
commit d29bdd1545
1 file changed
+9 -2
+9 -2
View File
@@ -873,7 +873,7 @@ class NetworkService {
}
async createStatusPage(config) {
const { authToken, user, form } = config;
const { authToken, user, form, isCreate } = config;
const fd = new FormData();
fd.append("isPublished", form.isPublished);
fd.append("companyName", form.companyName);
@@ -895,8 +895,15 @@ class NetworkService {
URL.revokeObjectURL(form.logo.src);
}
}
if (isCreate) {
return this.axiosInstance.post(`/status-page`, fd, {
headers: {
Authorization: `Bearer ${authToken}`,
},
});
}
return this.axiosInstance.post(`/status-page`, fd, {
return this.axiosInstance.put(`/status-page`, fd, {
headers: {
Authorization: `Bearer ${authToken}`,
},