mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 17:25:44 +00:00
36 lines
987 B
JavaScript
36 lines
987 B
JavaScript
|
/*****************************************************************************
|
||
|
* Users *
|
||
|
* Fetch requests for /users routes *
|
||
|
*****************************************************************************/
|
||
|
Requests.settings = {};
|
||
|
|
||
|
Requests.settings.entity = {};
|
||
|
|
||
|
Requests.settings.entity.delete = (userId) => {
|
||
|
let input = `/settings/${userId}`;
|
||
|
let init = {
|
||
|
method: 'DELETE'
|
||
|
};
|
||
|
return Requests.JSONfetch(input, init);
|
||
|
}
|
||
|
|
||
|
Requests.settings.entity.deleteAvatar = (userId) => {
|
||
|
let input = `/settings/${userId}/avatar`;
|
||
|
let init = {
|
||
|
method: 'DELETE'
|
||
|
};
|
||
|
return Requests.JSONfetch(input, init);
|
||
|
}
|
||
|
|
||
|
Requests.settings.entity.isPublic = {};
|
||
|
|
||
|
Requests.settings.entity.isPublic.update = (userId, isPublic) => {
|
||
|
let input = `/settings/${userId}/is_public`;
|
||
|
let init = {
|
||
|
method: 'PUT',
|
||
|
body: JSON.stringify(isPublic)
|
||
|
};
|
||
|
return Requests.JSONfetch(input, init);
|
||
|
};
|
||
|
|