Просмотр исходного кода

📝 docs(areas): update parentId description and validation

- 修改parentId字段描述为"父区域ID,自引用,顶级区域可不提供"
- 为CreateAreaDataDto中的parentId添加optional()验证规则
yourname 8 месяцев назад
Родитель
Сommit
1918ad2433
1 измененных файлов с 6 добавлено и 6 удалено
  1. 6 6
      src/server/modules/areas/area-data.entity.ts

+ 6 - 6
src/server/modules/areas/area-data.entity.ts

@@ -29,9 +29,9 @@ export const AreaDataSchema = z.object({
     description: '区域ID',
     example: 1 
   }),
-  parentId: z.number().int().positive().nullable().openapi({ 
-    description: '父区域ID,自引用',
-    example: 0 
+  parentId: z.number().int().positive().nullable().openapi({
+    description: '父区域ID,自引用,顶级区域可不提供',
+    example: 0
   }),
   name: z.string().max(100).openapi({ 
     description: '区域名称',
@@ -48,9 +48,9 @@ export const AreaDataSchema = z.object({
 });
 
 export const CreateAreaDataDto = z.object({
-  parentId: z.number().int().positive().nullable().openapi({ 
-    description: '父区域ID,自引用',
-    example: 0 
+  parentId: z.number().int().positive().nullable().optional().openapi({
+    description: '父区域ID,自引用,顶级区域可不提供',
+    example: 0
   }),
   name: z.string().max(100).openapi({ 
     description: '区域名称',