Extract server endpoints for thumbnails and extensions into separate files

This commit is contained in:
Cohee
2023-09-16 16:16:48 +03:00
parent 2d774f32b2
commit 6e562bd1ff
6 changed files with 499 additions and 423 deletions

View File

@ -8747,7 +8747,7 @@ jQuery(async function () {
/**
* Handles the click event for the third-party extension import button.
* Prompts the user to enter the Git URL of the extension to import.
* After obtaining the Git URL, makes a POST request to '/get_extension' to import the extension.
* After obtaining the Git URL, makes a POST request to '/api/extensions/install' to import the extension.
* If the extension is imported successfully, a success message is displayed.
* If the extension import fails, an error message is displayed and the error is logged to the console.
* After successfully importing the extension, the extension settings are reloaded and a 'EXTENSION_SETTINGS_LOADED' event is emitted.
@ -8770,7 +8770,7 @@ jQuery(async function () {
const url = input.trim();
console.debug('Extension import started', url);
const request = await fetch('/get_extension', {
const request = await fetch('/api/extensions/install', {
method: 'POST',
headers: getRequestHeaders(),
body: JSON.stringify({ url }),