Skip to content

Commit

Permalink
Fix general and emergency page lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardLinS committed May 27, 2024
1 parent 9ebee7e commit 76934ec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const CategoryItem: React.FC<CategoryItemProps> = ({ id, title, pages, onDeleteC
export const CategoryContainer: React.FC<{
items: Category[];
type: string;
onDeleteCategory: (categoryId: string) => void;
onDeleteCategory: (categoryId: string) => Promise<undefined>;
}> = ({ items: categories, type, onDeleteCategory }) => {
return (
<table>
Expand Down
8 changes: 5 additions & 3 deletions admin-portal-frontend/src/app/emergencies/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
"use client";

import { useEffect, useState } from "react";
import CategoryContainer from "../components/CategoryContainer";
import { Category, getAllCategories, deleteCategory } from "../components/categoryRoutes";

import { CategoryContainer } from "../components/CategoryContainer";
import Toast from "../components/Toast";

import { Category, deleteCategory, getAllCategories } from "../components/categoryRoutes";

export default function CategoriesPage() {
const [categories, setCategories] = useState([]);
const [showToast, setShowToast] = useState(false);
Expand All @@ -19,7 +21,7 @@ export default function CategoriesPage() {
}
};

fetchData();
void fetchData();
}, [categories]);

const onDeleteCategory = async (categoryId: string) => {
Expand Down
12 changes: 7 additions & 5 deletions admin-portal-frontend/src/app/general-principles/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
"use client";

import { useEffect, useState } from "react";
import CategoryContainer from "../components/CategoryContainer";
import { Category, getAllCategories, deleteCategory } from "../components/categoryRoutes";

import { CategoryContainer } from "../components/CategoryContainer";
import Toast from "../components/Toast";

import { Category, deleteCategory, getAllCategories } from "../components/categoryRoutes";

export default function CategoriesPage() {
const [categories, setCategories] = useState([]);
const [showToast, setShowToast] = useState(false);
Expand All @@ -19,7 +21,7 @@ export default function CategoriesPage() {
}
};

fetchData();
void fetchData();
}, [categories]);

const onDeleteCategory = async (categoryId: string) => {
Expand All @@ -41,8 +43,8 @@ export default function CategoriesPage() {
<div className="flex flex-row justify-between w-full md:w-5/6 lg:w-4/5 xl:w-3/4 mb-6">
<h1 className="text-start text-2xl font-bold">General Principles</h1>
<div>
<select className="px-3 py-1 bg-white">
<option disabled selected hidden>
<select defaultValue="Filter by" className="px-3 py-1 bg-white">
<option value="Filter by" disabled hidden>
Filter by
</option>
<option value="Alphabetical Order">Alphabetical Order</option>
Expand Down

0 comments on commit 76934ec

Please sign in to comment.