feat(doctors): add activity start date field with Persian calendar in admin panel
This commit is contained in:
@@ -14,6 +14,7 @@ import { api } from '../lib/api';
|
||||
import type { ApiResponse } from '../lib/api';
|
||||
import SearchableSelect from '../components/ui/SearchableSelect';
|
||||
import MobileInput from '../components/ui/MobileInput';
|
||||
import PersianDatePicker from '../components/ui/PersianDatePicker';
|
||||
import { iranMobileSchema } from '../lib/utils';
|
||||
import { useAuthStore } from '../stores/authStore';
|
||||
|
||||
@@ -261,6 +262,7 @@ export default function DoctorFormPage() {
|
||||
primaryRole === 'representation' ? '/api/v1/representation/doctor' : '/api/v1/admin/doctors';
|
||||
const [selectedSpecialties, setSelectedSpecialties] = useState<number[]>([]);
|
||||
const [gender, setGender] = useState<'man' | 'woman' | ''>('');
|
||||
const [activityDate, setActivityDate] = useState('');
|
||||
|
||||
const specialtiesQ = useQuery({
|
||||
queryKey: ['specialties-list'],
|
||||
@@ -286,6 +288,9 @@ export default function DoctorFormPage() {
|
||||
degree: values.degree || undefined,
|
||||
medical_system_code: values.medical_system_code || undefined,
|
||||
info: values.info || undefined,
|
||||
...(activityDate
|
||||
? { activity_time: Math.floor(new Date(`${activityDate}T12:00:00`).getTime() / 1000) }
|
||||
: {}),
|
||||
specialties: selectedSpecialties,
|
||||
}),
|
||||
onSuccess: (res) => {
|
||||
@@ -369,6 +374,18 @@ export default function DoctorFormPage() {
|
||||
</Field>
|
||||
</div>
|
||||
|
||||
<div style={{ marginTop: 14 }}>
|
||||
<Field label="تاریخ شروع فعالیت">
|
||||
<PersianDatePicker
|
||||
value={activityDate}
|
||||
onChange={setActivityDate}
|
||||
placeholder="انتخاب تاریخ"
|
||||
enableYearPicker
|
||||
minWidth={200}
|
||||
/>
|
||||
</Field>
|
||||
</div>
|
||||
|
||||
<div style={{ marginTop: 14 }}>
|
||||
<Field label="بیوگرافی">
|
||||
<textarea rows={3} className="cp-textarea" placeholder="معرفی کوتاهی از پزشک..." {...register('info')} style={{ resize: 'none' }} />
|
||||
|
||||
Reference in New Issue
Block a user