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"); }