mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 21:29:08 +00:00
[Breaking] Move automation api into new router with consistent routes
- Rename GET /api/automations to GET /api/automation - Rename POST /api/trigger/automation to POST /api/automation/trigger - Update calls to the automations API from the web app.
This commit is contained in:
@@ -74,7 +74,7 @@ import { KhojLogoType } from "../components/logo/khojLogo";
|
||||
|
||||
const automationsFetcher = () =>
|
||||
window
|
||||
.fetch("/api/automations")
|
||||
.fetch("/api/automation")
|
||||
.then((res) => res.json())
|
||||
.catch((err) => console.log(err));
|
||||
|
||||
@@ -245,7 +245,7 @@ function deleteAutomation(automationId: string, setIsDeleted: (isDeleted: boolea
|
||||
}
|
||||
|
||||
function sendAPreview(automationId: string, setToastMessage: (toastMessage: string) => void) {
|
||||
fetch(`/api/trigger/automation?automation_id=${automationId}`, { method: "POST" })
|
||||
fetch(`/api/automation/trigger?automation_id=${automationId}`, { method: "POST" })
|
||||
.then((response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error("Network response was not ok");
|
||||
|
||||
Reference in New Issue
Block a user