From 4f0f61817e191b31436a598054e68fb24fb5840c Mon Sep 17 00:00:00 2001 From: mustafa_98 Date: Fri, 16 Jan 2026 23:09:27 +0000 Subject: [PATCH] =?UTF-8?q?=D8=AD=D8=B0=D9=81=20api.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api.js | 69 ---------------------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 api.js diff --git a/api.js b/api.js deleted file mode 100644 index 5d0946f..0000000 --- a/api.js +++ /dev/null @@ -1,69 +0,0 @@ -// API Base URL من متغيرات البيئة -const API_BASE = import.meta.env.VITE_API_BASE ?? ""; - -// ========================= -// Schemas -// ========================= -async function getSchemas(type, payload) { - const r = await fetch(`${API_BASE}/api/get_schemas`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - type, - ...payload - }) - }); - return r.json(); -} - -// ========================= -// Tables -// ========================= -async function getTables(type, payload) { - const r = await fetch(`${API_BASE}/api/get_tables`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - type, - ...payload - }) - }); - return r.json(); -} - -// ========================= -// Start Migration -// ========================= -async function startMigration(type, payload) { - const r = await fetch(`${API_BASE}/api/migrate`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - type, - ...payload - }) - }); - return r.json(); -} - -// ========================= -// Progress -// ========================= -async function getProgress(type) { - const r = await fetch(`${API_BASE}/api/progress/${type}`); - return r.json(); -} - -// ========================= -// List Buckets -// ========================= -async function listBuckets(payload) { - const r = await fetch(`${API_BASE}/api/list_buckets`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify(payload) - }); - return r.json(); -} - -export { getSchemas, getTables, startMigration, getProgress, listBuckets }; \ No newline at end of file