Updated to v1.0.4, fixed admin global page and overall speed
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// /components/user-category-modal.tsx
|
||||
"use client"
|
||||
|
||||
import { useState, useEffect } from "react"
|
||||
@@ -32,7 +33,13 @@ export function UserCategoryModal({ isOpen, onClose, category, categoryName }: U
|
||||
const fetchUsers = async () => {
|
||||
setLoading(true)
|
||||
try {
|
||||
const response = await fetch(`/api/admin/users-by-category?category=${category}`)
|
||||
const response = await fetch(`/api/admin/users-by-category`, {
|
||||
method: "POST", // Changed from GET to POST
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({ category }), // Sending category in the request body
|
||||
})
|
||||
const data = await response.json()
|
||||
setUsers(data)
|
||||
} catch (err) {
|
||||
@@ -56,16 +63,15 @@ export function UserCategoryModal({ isOpen, onClose, category, categoryName }: U
|
||||
<div className="mt-4">
|
||||
{users.length > 0 ? (
|
||||
<Table>
|
||||
<TableHeader> {/* Removed text-center and dir="rtl" here to let individual heads control alignment */}
|
||||
<TableRow> {/* Removed text-center and dir="rtl" here to let individual heads control alignment */}
|
||||
{/* Added text-right to align column headers properly for RTL */}
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead className="text-right">שם</TableHead>
|
||||
<TableHead className="text-right">תחום</TableHead>
|
||||
<TableHead className="text-right">מסגרת</TableHead>
|
||||
<TableHead className="text-right">צוות</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody className="text-right"> {/* Keep text-right for cell content alignment */}
|
||||
<TableBody className="text-right">
|
||||
{users.map((user) => (
|
||||
<TableRow key={user.national_id}>
|
||||
<TableCell className="font-medium">{user.name}</TableCell>
|
||||
|
||||
Reference in New Issue
Block a user