Added public visibility toggle to user page stashes.
This commit is contained in:
@@ -25,9 +25,9 @@ async function get(endpoint, query = {}) {
|
||||
throw new Error(errorMsg);
|
||||
}
|
||||
|
||||
async function post(endpoint, data) {
|
||||
async function post(endpoint, data, method = 'POST') {
|
||||
const res = await fetch(`${config.api.url}${endpoint}`, {
|
||||
method: 'POST',
|
||||
method,
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -51,6 +51,14 @@ async function post(endpoint, data) {
|
||||
throw new Error(errorMsg);
|
||||
}
|
||||
|
||||
async function patch(endpoint, data) {
|
||||
return post(endpoint, data, 'PATCH');
|
||||
}
|
||||
|
||||
async function put(endpoint, data) {
|
||||
return post(endpoint, data, 'PUT');
|
||||
}
|
||||
|
||||
async function del(endpoint) {
|
||||
const res = await fetch(`${config.api.url}${endpoint}`, {
|
||||
method: 'DELETE',
|
||||
@@ -97,4 +105,6 @@ export {
|
||||
post,
|
||||
del,
|
||||
graphql,
|
||||
patch,
|
||||
put,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user