Refactor AdminPage and remove AdminPanel component: Simplify admin navigation by redirecting to preferences page and eliminating the AdminPanel component, streamlining the admin interface.
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 6m21s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 6m21s
This commit is contained in:
@@ -71,9 +71,13 @@ const getRoleColor = (role: string) => {
|
||||
}
|
||||
};
|
||||
|
||||
export default function HouseManagement() {
|
||||
const [houses, setHouses] = useState<House[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
interface HouseManagementProps {
|
||||
initialHouses: House[];
|
||||
}
|
||||
|
||||
export default function HouseManagement({ initialHouses }: HouseManagementProps) {
|
||||
const [houses, setHouses] = useState<House[]>(initialHouses);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [editingHouse, setEditingHouse] = useState<House | null>(null);
|
||||
const [saving, setSaving] = useState(false);
|
||||
const [deletingHouseId, setDeletingHouseId] = useState<string | null>(null);
|
||||
@@ -85,10 +89,6 @@ export default function HouseManagement() {
|
||||
});
|
||||
const [, startTransition] = useTransition();
|
||||
|
||||
useEffect(() => {
|
||||
fetchHouses();
|
||||
}, []);
|
||||
|
||||
const fetchHouses = async () => {
|
||||
try {
|
||||
const response = await fetch("/api/admin/houses");
|
||||
@@ -98,8 +98,6 @@ export default function HouseManagement() {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching houses:", error);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user