mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 09:15:41 +00:00
17 lines
709 B
JavaScript
17 lines
709 B
JavaScript
|
/*****************************************************************************
|
||
|
* Settings *
|
||
|
* Fetch requests for /users/<entity>/settings routes *
|
||
|
*****************************************************************************/
|
||
|
Requests.users.entity.settings = {};
|
||
|
|
||
|
Requests.users.entity.settings.profilePrivacy = {};
|
||
|
|
||
|
Requests.users.entity.settings.profilePrivacy.update = (userId, profilePrivacySetting, enabled) => {
|
||
|
let input = `/users/${userId}/settings/profile-privacy/${profilePrivacySetting}`;
|
||
|
let init = {
|
||
|
method: 'PUT',
|
||
|
body: JSON.stringify(enabled)
|
||
|
};
|
||
|
return Requests.JSONfetch(input, init);
|
||
|
}
|