completionId: cgen-0d23a470718c41fbb06f2f6a4bbcdd2b

cgen-0d23a470718c41fbb06f2f6a4bbcdd2b
This commit is contained in:
Builder.io 2025-11-11 02:12:58 +00:00
parent bec0c04d5d
commit 8fbff201c8

View file

@ -73,12 +73,13 @@ export default function AdminStaffDirectory() {
method: "POST",
});
// Read response body once
const result = await response.json();
if (!response.ok) {
const error = await response.json();
throw new Error(error.details || error.error);
throw new Error(result.details || result.error || "Failed to seed data");
}
const result = await response.json();
setTeamMembers(result.members || []);
aethexToast.success({