Skip to content

Commit

Permalink
fix: zod missing media enumeration #487 (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyp3rius authored Dec 26, 2024
1 parent 5899e56 commit 32cb5cd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion admin/src/api/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export const contentTypeFieldTypeSchema = z.enum([
'decimal',
'json',
'relation',
'media',
]);

export type SimpleContentTypeAttribute = z.infer<typeof simpleContentTypeAttribute>;
Expand Down Expand Up @@ -225,7 +226,7 @@ export const contentTypeDynamicZoneAttribute = z.object({
export type ContentTypeMediaAttribute = z.infer<typeof contentTypeMediaAttribute>;
export const contentTypeMediaAttribute = z.object({
media: z.literal('media'),
allowedTypes: z.enum(['images', 'videos', 'files']).array(),
allowedTypes: z.enum(['images', 'videos', 'audios', 'files']).array(),
required: z.boolean().optional(),
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "strapi-plugin-navigation",
"version": "3.0.1",
"version": "3.0.2",
"description": "Strapi - Navigation plugin",
"strapi": {
"name": "navigation",
Expand Down
3 changes: 2 additions & 1 deletion server/src/schemas/content-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const contentTypeFieldTypeSchema = z.enum([
'decimal',
'json',
'relation',
'media',
]);

export type SimpleContentTypeAttribute = z.infer<typeof simpleContentTypeAttribute>;
Expand Down Expand Up @@ -78,7 +79,7 @@ export const contentTypeUidAttribute = z.object({
export type ContentTypeMediaAttribute = z.infer<typeof contentTypeMediaAttribute>;
export const contentTypeMediaAttribute = z.object({
type: z.literal('media'),
allowedTypes: z.enum(['images', 'videos', 'files']).array(),
allowedTypes: z.enum(['images', 'videos', 'audios', 'files']).array(),
required: z.boolean().optional(),
});

Expand Down

0 comments on commit 32cb5cd

Please sign in to comment.