modify network request to allow updating
This commit is contained in:
1 parent
76b21f1d8c
commit
d29bdd1545
1 file changed
+9
-2
@@ -873,7 +873,7 @@ class NetworkService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async createStatusPage(config) {
|
async createStatusPage(config) {
|
||||||
const { authToken, user, form } = config;
|
const { authToken, user, form, isCreate } = config;
|
||||||
const fd = new FormData();
|
const fd = new FormData();
|
||||||
fd.append("isPublished", form.isPublished);
|
fd.append("isPublished", form.isPublished);
|
||||||
fd.append("companyName", form.companyName);
|
fd.append("companyName", form.companyName);
|
||||||
@@ -895,8 +895,15 @@ class NetworkService {
|
|||||||
URL.revokeObjectURL(form.logo.src);
|
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: {
|
headers: {
|
||||||
Authorization: `Bearer ${authToken}`,
|
Authorization: `Bearer ${authToken}`,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user