работа с публикацией

This commit is contained in:
2025-12-20 12:19:33 +03:00
parent e83647042f
commit b1e99277d1
16 changed files with 1344 additions and 165 deletions
+6 -6
View File
@@ -54,7 +54,7 @@ async function saveServerUrl() {
}
try {
const response = await fetch('/settings/medods', {
const response = await fetch('/api/medods', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ url: serverUrl })
@@ -107,7 +107,7 @@ async function uploadApiKey() {
apiKey[headers[i]] = keyInfo[i];
}
const response = await fetch('/settings/medods', {
const response = await fetch('/api/medods', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ apiKey })
@@ -132,7 +132,7 @@ async function uploadApiKey() {
// Загрузка списка запросов
async function loadRequests() {
try {
const response = await fetch('/settings/requests');
const response = await fetch('/api/requests');
const data = await response.json();
requestsData = data.requests ? data.requests : [];
renderRequestsList();
@@ -392,7 +392,7 @@ async function saveRequest() {
if (id) requestData.id = parseInt(id);
try {
const response = await fetch('/settings/requests', {
const response = await fetch('/api/requests', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(requestData)
@@ -417,7 +417,7 @@ async function deleteRequest(id) {
if (!confirm('Вы уверены, что хотите удалить этот запрос?')) return;
try {
const response = await fetch(`/settings/requests/${id}`, {
const response = await fetch(`/api/requests/${id}`, {
method: 'DELETE'
});
@@ -448,7 +448,7 @@ async function executeCurrentRequest() {
async function executeRequest(id) {
try {
showLoader(true);
const response = await fetch('/settings/requests', {
const response = await fetch('/api/requests', {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ id: parseInt(id) })