Skip to content

Commit

Permalink
Updated API to match backend document changes
Browse files Browse the repository at this point in the history
  • Loading branch information
timwekkenbc committed Jun 17, 2024
1 parent 3a415f9 commit d979704
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const getAllRuleData = async (): Promise<RuleInfo[]> => {
*/
export const getAllRuleDocuments = async (): Promise<string[]> => {
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}`);
Expand All @@ -64,7 +64,7 @@ export const getAllRuleDocuments = async (): Promise<string[]> => {
*/
export const getDocument = async (jsonFilePath: string): Promise<DecisionGraphType> => {
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");
}
Expand Down

0 comments on commit d979704

Please sign in to comment.