From d97970458e649eccef74291f0d26cd1209426fbd Mon Sep 17 00:00:00 2001 From: timwekkenbc Date: Mon, 17 Jun 2024 11:01:26 -0700 Subject: [PATCH] Updated API to match backend document changes --- app/utils/api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/utils/api.ts b/app/utils/api.ts index 5cda18e..45ed512 100644 --- a/app/utils/api.ts +++ b/app/utils/api.ts @@ -48,7 +48,7 @@ export const getAllRuleData = async (): Promise => { */ export const getAllRuleDocuments = async (): Promise => { try { - const { data } = await axiosAPIInstance.get("/documents"); + const { data } = await axiosAPIInstance.get("/documents/all"); return data; } catch (error) { console.error(`Error fetching rule data: ${error}`); @@ -64,7 +64,7 @@ export const getAllRuleDocuments = async (): Promise => { */ export const getDocument = async (jsonFilePath: string): Promise => { try { - const { data } = await axiosAPIInstance.get(`/documents/${encodeURIComponent(jsonFilePath)}`); + const { data } = await axiosAPIInstance.get(`/documents?ruleFileName=${jsonFilePath}`); if (!data || !data.nodes || !data.edges) { throw new Error("Unexpected format of the returned data"); }