Skip to content

Commit

Permalink
fix: minor change on biotopeDto and schema injector
Browse files Browse the repository at this point in the history
  • Loading branch information
smyllet committed May 13, 2024
1 parent 1da9f7b commit 75fc8a2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions src/dto/biotope/BiotopeCreateDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export const BiotopeCreateDtoSchema = z.object({
name: z.string().min(1).max(100),
description: z.string().max(255).optional(),
startedDate: z.coerce.date().optional(),
image: z.custom<Blob>().optional(),
volume: z.number().optional(),
image: z.custom<Blob>().optional().nullable(),
volume: z.number().optional().nullable(),
});

export type BiotopeCreateDto = z.infer<typeof BiotopeCreateDtoSchema>;
4 changes: 2 additions & 2 deletions src/dto/biotope/BiotopeUpdateDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export const BiotopeUpdateDtoSchema = z
name: z.string().min(1).max(100),
description: z.string().max(255),
startedDate: z.coerce.date(),
image: z.custom<Blob>(),
volume: z.number(),
image: z.custom<Blob>().nullable(),
volume: z.number().nullable(),
})
.partial();

Expand Down
4 changes: 0 additions & 4 deletions src/utils/routeOptionInjection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ export function injectResponseSchemaInRouteOption(
routeOptions.schema.response = {};
}

if (!routeOptions.schema.response[200] && statusCode !== 200) {
routeOptions.schema.response[200] = z.void();
}

if (
!routeOptions.schema.response[statusCode] ||
routeOptions.schema.response[statusCode] instanceof z.ZodVoid
Expand Down

0 comments on commit 75fc8a2

Please sign in to comment.