modifying the frontend to send the image and getting the data
This commit is contained in:
@ -11,6 +11,11 @@ export async function restPost(endPoint, data) {
|
||||
return await _rest(endPoint, {method: "POST", credentials: 'include', body: JSON.stringify(data)});
|
||||
}
|
||||
|
||||
export async function restPostFile(endPoint, file){
|
||||
let headers = new Headers();
|
||||
return await _rest(endPoint, {method: "POST", credentials: 'include', body: file, headers: headers });
|
||||
}
|
||||
|
||||
export async function restDelete(endPoint, data) {
|
||||
return await _rest(endPoint, {method: "DELETE", credentials: 'include', body: JSON.stringify(data)});
|
||||
}
|
||||
@ -35,7 +40,7 @@ async function _rest(endPoint, config){
|
||||
'Authorization': session_token,
|
||||
'Content-Type': 'application/json',
|
||||
});
|
||||
config['headers'] = headers;
|
||||
config['headers'] = config['headers'] == null ? headers : config['headers'];
|
||||
return toast.promise(fetch(restURL + endPoint, config),
|
||||
{
|
||||
pending: config['pending'] != null ? config['pending'] : 'pending',
|
||||
|
Reference in New Issue
Block a user