feat: Add City entity methods and migration for title field
- Created a new JSON file for the City entity's AST representation, detailing its methods and properties. - Added a migration to alter the cities table by adding a nullable title column.
This commit is contained in:
@@ -371,6 +371,7 @@ function ProvincesTab() {
|
||||
const citySchema = z.object({
|
||||
name: z.string().min(1, 'نام الزامی است'),
|
||||
site_name: z.string().optional(),
|
||||
title: z.string().optional(),
|
||||
province_id: z.number().nullable().optional(),
|
||||
weight: z.string().optional(),
|
||||
status: z.string().optional(),
|
||||
@@ -438,6 +439,7 @@ function CitiesTab() {
|
||||
province_id: d.province_id ?? null,
|
||||
representation_id: d.representation_id ?? null,
|
||||
...(d.site_name?.trim() && { site_name: d.site_name.trim() }),
|
||||
...(d.title?.trim() && { title: d.title.trim() }),
|
||||
...(d.contact_phone?.trim() && { contact_phone: d.contact_phone.trim() }),
|
||||
...(d.email?.trim() && { email: d.email.trim() }),
|
||||
...(d.description?.trim() && { description: d.description.trim() }),
|
||||
@@ -470,6 +472,7 @@ function CitiesTab() {
|
||||
reset({
|
||||
name: c.name, weight: String(c.weight), status: String(c.status),
|
||||
site_name: c.site_name ?? '',
|
||||
title: c.title ?? '',
|
||||
province_id: c.province_id ?? null,
|
||||
representation_id: c.representation_id ?? null,
|
||||
contact_phone: c.contact_phone ?? '',
|
||||
@@ -519,6 +522,10 @@ function CitiesTab() {
|
||||
<label>نام سایت</label>
|
||||
<input {...register('site_name')} className="input" placeholder="مثال: یزد نوبت" />
|
||||
</div>
|
||||
<div className="form-row" style={{ marginTop: 12 }}>
|
||||
<label>عنوان سئو (title)</label>
|
||||
<input {...register('title')} className="input" placeholder="مثال: نوبتدهی آنلاین پزشکان یزد | یزد نوبت" />
|
||||
</div>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, marginTop: 12 }}>
|
||||
<div className="form-row">
|
||||
<label>استان</label>
|
||||
|
||||
@@ -239,6 +239,7 @@ export interface City {
|
||||
uuid: string;
|
||||
name: string;
|
||||
site_name?: string | null;
|
||||
title?: string | null;
|
||||
status: number;
|
||||
weight: number;
|
||||
province_id: number | null;
|
||||
|
||||
Reference in New Issue
Block a user