add(settings): password changing

This commit is contained in:
AdrienLSH
2024-03-19 13:59:21 +01:00
parent 837ed85001
commit 0371881afa
13 changed files with 234 additions and 99 deletions

View File

@ -144,6 +144,26 @@ class Client
return response;
}
/**
* Send a PUT request with json
* @param {String} uri
* @param {*} data
* @returns {Promise<Response>}
*/
async _put(uri, data)
{
let response = await fetch(this._url + uri, {
method: "PUT",
headers: {
"X-CSRFToken": getCookie("csrftoken"),
"Content-Type": "application/json",
'Accept-Language': this.lang.currentLang,
},
body: JSON.stringify(data),
});
return response;
}
/**
* Send a PATCH request with json
* @param {String} uri