1
0
forked from PGL/Clyde

fix expiration date and frontend requests

This commit is contained in:
2024-03-09 16:22:38 +01:00
parent 847b1ca419
commit ac88307036
2 changed files with 4 additions and 5 deletions

View File

@ -8,15 +8,15 @@ export async function restGet(endPoint) {
}
export async function restPost(endPoint, data) {
return await _rest(endPoint, {method: "POST", body: JSON.stringify(data)});
return await _rest(endPoint, {method: "POST", credentials: 'include', body: JSON.stringify(data)});
}
export async function restDelete(endPoint, data) {
return await _rest(endPoint, {method: "DELETE", body: JSON.stringify(data)});
return await _rest(endPoint, {method: "DELETE", credentials: 'include', body: JSON.stringify(data)});
}
export async function restPatch(endPoint, data) {
return await _rest(endPoint, {method: "PATCH", body: JSON.stringify(data)});
return await _rest(endPoint, {method: "PATCH", credentials: 'include', body: JSON.stringify(data)});
}
/**
@ -36,7 +36,6 @@ async function _rest(endPoint, config){
'Content-Type': 'application/json',
});
config['headers'] = headers;
config['credentials'] = 'include'
return toast.promise(fetch(restURL + endPoint, config),
{
pending: config['pending'] != null ? config['pending'] : 'pending',