Skip to content

Commit 7d80dbe

Browse files
authored
fix/317: fix schema on FE (#335)
1 parent f6258b1 commit 7d80dbe

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

admin/src/api/schemas.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,10 @@ const approvalStatusSchema = z.union([
8282
z.literal(COMMENT_STATUS.TO_REVIEW),
8383
z.literal(COMMENT_STATUS.UNKNOWN),
8484
]);
85-
const reportReasonUnion = z.union([
86-
z.literal('BAD_LANGUAGE'),
87-
z.literal('DISCRIMINATION'),
88-
z.literal('OTHER'),
89-
]);
85+
9086
const commentReportSchema = z.object({
9187
id: z.number(),
92-
reason: reportReasonUnion,
88+
reason: z.string().optional().nullable(),
9389
content: z.string(),
9490
resolved: z.boolean(),
9591
createdAt: z.string(),
@@ -200,7 +196,7 @@ export const reportSchema = z.object({
200196
content: z.string(),
201197
id: z.number(),
202198
approvalStatus: approvalStatusSchema.nullable().optional(),
203-
reason: reportReasonUnion,
199+
reason: z.string().optional().nullable(),
204200
reports: z.array(z.unknown()),
205201
resolved: z.boolean().optional(),
206202
updatedAt: z.string().nullable(),

0 commit comments

Comments
 (0)