Extract endpoints for secrets and assets to separate files

This commit is contained in:
Cohee
2023-09-16 16:39:07 +03:00
parent 6e562bd1ff
commit 4e1630c17d
8 changed files with 394 additions and 359 deletions

View File

@ -150,7 +150,7 @@ async function installAsset(url, assetType, filename) {
const category = assetType;
try {
const body = { url, category, filename };
const result = await fetch('/asset_download', {
const result = await fetch('/api/assets/download', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify(body),
@ -171,7 +171,7 @@ async function deleteAsset(assetType, filename) {
const category = assetType;
try {
const body = { category, filename };
const result = await fetch('/asset_delete', {
const result = await fetch('/api/assets/delete', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify(body),
@ -194,7 +194,7 @@ async function deleteAsset(assetType, filename) {
async function updateCurrentAssets() {
console.debug(DEBUG_PREFIX, "Checking installed assets...")
try {
const result = await fetch(`/get_assets`, {
const result = await fetch(`/api/assets/get`, {
method: 'POST',
headers: getRequestHeaders(),
});