Skip to content

Commit

Permalink
Fix API_URL error and Toast brace arrow error
Browse files Browse the repository at this point in the history
  • Loading branch information
r800360 committed May 21, 2024
1 parent 8905656 commit 2280dd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion admin-portal-frontend/src/app/components/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const Toast: React.FC<ToastProps> = ({ backgroundColor, message, onClose }) => {
onClose();
}, 10000);

return () => clearTimeout(timer);
return () => {
clearTimeout(timer);
};
}, []);

return (
Expand Down
4 changes: 4 additions & 0 deletions admin-portal-frontend/src/app/components/categoryRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export const getAllCategories = async () => {
// Deletes a specific category
export const deleteCategory = async (itemId: string) => {
try {
if (!process.env.API_URL) {
throw new Error("API URL is not defined");
}

const url = process.env.API_URL + `/${itemId}`;

if (!url) {
Expand Down

0 comments on commit 2280dd1

Please sign in to comment.