This commit is contained in:
Slipstream 2025-05-03 19:46:35 -06:00
parent dad436fb72
commit d526eefe81
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD

View File

@ -378,6 +378,24 @@ const API = {
);
},
/**
* Make a PATCH request
* @param {string} url - The API endpoint URL
* @param {Object} data - The data to send
* @param {HTMLElement} loadingElement - Element to show loading state on
* @returns {Promise} - The fetch promise
*/
async patch(url, data, loadingElement = null) {
return this.request(
url,
{
method: 'PATCH',
body: JSON.stringify(data)
},
loadingElement
);
},
/**
* Make a DELETE request
* @param {string} url - The API endpoint URL