/api/users returns { users: [...] } but setUsers was receiving
the full wrapper object instead of the inner array.
This commit is contained in:
@@ -168,7 +168,7 @@ function NewProjectDialog({ statuses, onCreated }: { statuses: ProjectStatus[];
|
||||
useEffect(() => {
|
||||
if (!open) return
|
||||
fetch("/api/customers?limit=100").then(r => r.json()).then(setCustomers).catch(() => {})
|
||||
fetch("/api/users").then(r => r.json()).then(setUsers).catch(() => {})
|
||||
fetch("/api/users").then(r => r.json()).then(d => setUsers(d.users || [])).catch(() => {})
|
||||
}, [open])
|
||||
|
||||
const handleSubmit = async () => {
|
||||
|
||||
Reference in New Issue
Block a user