Skip to content

Agent Zero AI framework

fix scheduler api calls

frdel68e65ae87369
diff --git a/webui/components/modals/scheduler/scheduler-store.js b/webui/components/modals/scheduler/scheduler-store.js
index bda9dc4e6..cc654bf02 100644
--- a/webui/components/modals/scheduler/scheduler-store.js
+++ b/webui/components/modals/scheduler/scheduler-store.js
@@ -1,10 +1,10 @@
import { createStore } from "/js/AlpineStore.js";
+import { fetchApi } from "/js/api.js";
import { formatDateTime, getUserTimezone } from "/js/time-utils.js";
import { store as chatsStore } from "/components/sidebar/chats/chats-store.js";
import { store as projectsStore } from "/components/projects/projects-store.js";
import { store as notificationsStore } from "/components/notifications/notification-store.js";
-const API = globalThis.fetchApi || globalThis.fetch;
const VIEW_MODE_STORAGE_KEY = "scheduler_view_mode";
const NOTIFICATION_DURATION = {
success: 3,
@@ -268,7 +268,7 @@ function buildPayloadFromEditingTask(editingTask, { isCreating = false } = {}) {
async function callSchedulerEndpoint(endpoint, payload = {}, defaultError) {
try {
- const response = await API(endpoint, {
+ const response = await fetchApi(endpoint, {
method: "POST",
headers: {
"Content-Type": "application/json",