feat: update ClinicDetailPage and ClinicsPage for address handling and UI improvements
This commit is contained in:
@@ -22,6 +22,7 @@ import ConfirmDialog from '../components/ui/ConfirmDialog';
|
||||
const HUES_LIST = [256, 205, 162, 295, 272];
|
||||
|
||||
const addSchema = z.object({
|
||||
owner_mobile: z.string().min(10, 'شماره موبایل معتبر نیست'),
|
||||
name: z.string().min(2, 'نام الزامی است'),
|
||||
telephone: z.string().optional(),
|
||||
});
|
||||
@@ -69,7 +70,7 @@ export default function ClinicsPage() {
|
||||
const addForm = useForm<AddForm>({ resolver: zodResolver(addSchema) });
|
||||
|
||||
const addMutation = useMutation({
|
||||
mutationFn: (d: AddForm) => api.post<ApiResponse<{ uuid: string }>>('/api/v1/clinic', d),
|
||||
mutationFn: (d: AddForm) => api.post<ApiResponse<{ uuid: string }>>('/api/v1/admin/clinic', d),
|
||||
onSuccess: (res) => {
|
||||
toast.success('کلینیک اضافه شد');
|
||||
setAddOpen(false);
|
||||
@@ -237,7 +238,16 @@ export default function ClinicsPage() {
|
||||
<div className="modal-body" style={{ display: 'flex', flexDirection: 'column', gap: 14 }}>
|
||||
<div>
|
||||
<label style={{ fontSize: 13, fontWeight: 600, marginBottom: 6, display: 'block' }}>
|
||||
نام کلینیک
|
||||
شماره موبایل صاحب کلینیک <span style={{ color: 'var(--red)' }}>*</span>
|
||||
</label>
|
||||
<input className="input" placeholder="09xxxxxxxxx" dir="ltr" {...addForm.register('owner_mobile')} />
|
||||
{addForm.formState.errors.owner_mobile && (
|
||||
<div className="err-text">{addForm.formState.errors.owner_mobile.message}</div>
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
<label style={{ fontSize: 13, fontWeight: 600, marginBottom: 6, display: 'block' }}>
|
||||
نام کلینیک <span style={{ color: 'var(--red)' }}>*</span>
|
||||
</label>
|
||||
<input className="input" placeholder="نام کلینیک را وارد کنید" {...addForm.register('name')} />
|
||||
{addForm.formState.errors.name && (
|
||||
|
||||
Reference in New Issue
Block a user