Bug 37762: VueJS framework: Add patch to http-client.js

Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2025-09-17 14:44:27 +00:00 committed by Lucas Gass
parent 9e420632e7
commit 675dd1cac0
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 21 additions and 0 deletions

View File

@ -183,6 +183,27 @@ class HttpClient {
);
}
patch(params = {}) {
const body = params.body
? typeof params.body === "string"
? params.body
: JSON.stringify(params.body)
: undefined;
let csrf_token = { "CSRF-TOKEN": this.csrf_token };
let headers = { ...csrf_token, ...params.headers };
return this._fetchJSON(
params.endpoint,
headers,
{
...params.options,
body,
method: "PATCH",
},
params.return_response ?? false,
params.mark_submitting ?? true
);
}
delete(params = {}) {
let csrf_token = { "CSRF-TOKEN": this.csrf_token };
let headers = { ...csrf_token, ...params.headers };