Skip to content

Commit

Permalink
Update frontend API endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
NoraKri committed Jan 29, 2025
1 parent ab25187 commit 7553c6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
24 changes: 12 additions & 12 deletions client/Boundaries/Backend/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
await RdfoxApi.LoadData(conn, data);

return Results.Ok($"Triple with subject {packageId} and object {nodeId} inserted successfully.");
}).WithTag("Boundary");
}).WithTags("Boundary");


// Remove node as boundary
Expand All @@ -96,7 +96,7 @@
await RdfoxApi.DeleteData(conn, data);

return Results.Ok($"Triple for package {packageId} and node {nodeId} deleted successfully.");
}).WithTag("Boundary");
}).WithTags("Boundary");


// ============ INTERNAL ============
Expand Down Expand Up @@ -128,7 +128,7 @@
}

return Results.Ok();
}).WithTag("Internal");
}).WithTags("Internal");


//Add node as internal
Expand All @@ -149,7 +149,7 @@
await RdfoxApi.LoadData(conn, data);

return Results.Ok($"Triple for package {packageId} and node {nodeId} inserted successfully.");
}).WithTag("Internal");
}).WithTags("Internal");


// Remove node as internal
Expand All @@ -170,7 +170,7 @@
await RdfoxApi.DeleteData(conn, data);

return Results.Ok($"Triple for package {packageId} and node {nodeId} deleted successfully.");
}).WithTag("Internal");
}).WithTags("Internal");


// ============ NODES ============
Expand Down Expand Up @@ -205,7 +205,7 @@
}

return Results.Ok(adjacentNodes);
}).WithTag("Nodes");
}).WithTags("Nodes");


// ============ COMMISSIONING PACKAGE ============
Expand All @@ -221,7 +221,7 @@
await RdfoxApi.LoadData(conn, data.ToString());

return Results.Ok($"Commissioning package {commissioningPackage.Id} added successfully.");
}).WithTag("Commissioning Package");
}).WithTags("Commissioning Package");


// Update commissioning package - updating information like name and color while persisting the calculated internal nodes, and boundaries.
Expand Down Expand Up @@ -266,7 +266,7 @@
await RdfoxApi.LoadData(conn, data);

return Results.Ok($"Commissioning package {updatedPackage.Id} updated successfully.");
}).WithTag("Commissioning Package");
}).WithTags("Commissioning Package");


//Get commissioning package
Expand Down Expand Up @@ -305,7 +305,7 @@
}

return Results.Ok(commissioningPackage);
}).WithTag("Commissioning Package");
}).WithTags("Commissioning Package");


//Delete commissioning package
Expand Down Expand Up @@ -374,7 +374,7 @@

return Results.Ok($"Commissioning package {commissioningPackageId} deleted successfully.");

}).WithTag("Commissioning Package");
}).WithTags("Commissioning Package");


//Get all commissioning packages
Expand Down Expand Up @@ -427,7 +427,7 @@
}

return Results.Ok(commissioningPackages);
}).WithTag("Commissioning Package");
}).WithTags("Commissioning Package");


//Get the ID of all commissioning packages
Expand All @@ -449,6 +449,6 @@
.ToList();

return Results.Ok(packageIds);
}).WithTag("Commissioning Package");
}).WithTags("Commissioning Package");

app.Run();
4 changes: 1 addition & 3 deletions www/src/utils/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ export const getCommissioningPackage = async (
export const getAllCommissioningPackages = async (): Promise<
CommissioningPackage[]
> => {
const response = await fetch(
`${BASE_URL}/commissioning-package/get-all-commissioning-packages`,
);
const response = await fetch(`${BASE_URL}/commissioning-package/all`);
return response.json();
};

Expand Down

0 comments on commit 7553c6a

Please sign in to comment.