Extract API endpoints for images

This commit is contained in:
Cohee
2024-03-20 00:59:06 +02:00
parent 7dcd39c806
commit b261c8c4a9
4 changed files with 104 additions and 89 deletions

View File

@ -29,7 +29,7 @@ let galleryMaxRows = 3;
* @returns {Promise<Array>} - Resolves with an array of gallery item objects, rejects on error.
*/
async function getGalleryItems(url) {
const response = await fetch(`/listimgfiles/${url}`, {
const response = await fetch(`/api/images/list/${url}`, {
method: 'POST',
headers: getRequestHeaders(),
});
@ -201,7 +201,7 @@ async function uploadFile(file, url) {
'Content-Type': 'application/json',
});
const response = await fetch('/uploadimage', {
const response = await fetch('/api/images/upload', {
method: 'POST',
headers: headers,
body: JSON.stringify(payload),