Extract API endpoints for user avatars

This commit is contained in:
Cohee
2024-03-20 00:39:48 +02:00
parent 41528d0423
commit d448d4f65b
4 changed files with 76 additions and 58 deletions

View File

@@ -46,7 +46,7 @@ async function uploadUserAvatar(url, name) {
return jQuery.ajax({
type: 'POST',
url: '/uploaduseravatar',
url: '/api/avatars/upload',
data: formData,
beforeSend: () => { },
cache: false,
@@ -355,7 +355,7 @@ async function deleteUserAvatar(e) {
return;
}
const request = await fetch('/deleteuseravatar', {
const request = await fetch('/api/avatars/delete', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify({