fix: rename User Settings to Admin Settings
This commit is contained in:
@@ -44,9 +44,9 @@ export default function SettingsPage() {
|
|||||||
const addStaffMutate = useMutation<
|
const addStaffMutate = useMutation<
|
||||||
Staff, // Return type
|
Staff, // Return type
|
||||||
Error, // Error type
|
Error, // Error type
|
||||||
Omit<Staff, "id" | "createdAt"> // Variables
|
Omit<Staff, "id" | "userId" | "createdAt"> // Variables
|
||||||
>({
|
>({
|
||||||
mutationFn: async (newStaff: Omit<Staff, "id" | "createdAt">) => {
|
mutationFn: async (newStaff: Omit<Staff, "id" | "userId" | "createdAt">) => {
|
||||||
const res = await apiRequest("POST", "/api/staffs/", newStaff);
|
const res = await apiRequest("POST", "/api/staffs/", newStaff);
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
const errorData = await res.json().catch(() => null);
|
const errorData = await res.json().catch(() => null);
|
||||||
@@ -157,7 +157,7 @@ export default function SettingsPage() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Handle form submit for Add or Edit
|
// Handle form submit for Add or Edit
|
||||||
const handleFormSubmit = (formData: Omit<Staff, "id" | "createdAt">) => {
|
const handleFormSubmit = (formData: Omit<Staff, "id" | "userId" | "createdAt">) => {
|
||||||
if (editingStaff) {
|
if (editingStaff) {
|
||||||
// Editing existing staff
|
// Editing existing staff
|
||||||
if (editingStaff.id === undefined) {
|
if (editingStaff.id === undefined) {
|
||||||
@@ -433,7 +433,7 @@ export default function SettingsPage() {
|
|||||||
{/* User Setting section */}
|
{/* User Setting section */}
|
||||||
<Card className="mt-6">
|
<Card className="mt-6">
|
||||||
<CardContent className="space-y-4 py-6">
|
<CardContent className="space-y-4 py-6">
|
||||||
<h3 className="text-lg font-semibold">User Settings</h3>
|
<h3 className="text-lg font-semibold">Admin Settings</h3>
|
||||||
<form
|
<form
|
||||||
className="space-y-4"
|
className="space-y-4"
|
||||||
onSubmit={(e) => {
|
onSubmit={(e) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user