Update api.js
This commit is contained in:
1 parent
487773788d
commit
b603091c0e
1 file changed
+4
-4
@@ -287,19 +287,19 @@ const API = {
|
|||||||
return data || [];
|
return data || [];
|
||||||
},
|
},
|
||||||
|
|
||||||
async createCustomPage(name, title, content, sort_order) {
|
async createCustomPage(name, title, content) {
|
||||||
const data = await apiFetch('/admin/custom-pages', {
|
const data = await apiFetch('/admin/custom-pages', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify({ name, title, content, sort_order })
|
body: JSON.stringify({ name, title, content })
|
||||||
});
|
});
|
||||||
if (data.error) throw new Error(data.error);
|
if (data.error) throw new Error(data.error);
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
|
|
||||||
async updateCustomPage(id, title, content, sort_order, enabled) {
|
async updateCustomPage(id, title, content, enabled) {
|
||||||
const data = await apiFetch('/admin/custom-pages/' + id, {
|
const data = await apiFetch('/admin/custom-pages/' + id, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
body: JSON.stringify({ title, content, sort_order, enabled })
|
body: JSON.stringify({ title, content, enabled })
|
||||||
});
|
});
|
||||||
if (data.error) throw new Error(data.error);
|
if (data.error) throw new Error(data.error);
|
||||||
return data;
|
return data;
|
||||||
|
|||||||
Reference in new issue
Block a user