generated from sripwoud/ts-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
367 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { QuestionType } from 'server/questions/dto' | ||
import { z } from 'zod' | ||
|
||
export const CreateFeedbackDto = z.object({ | ||
feedback: z.boolean(), | ||
questionId: z.number().positive(), | ||
type: z.enum([QuestionType.BOOLEAN, QuestionType.TEXT]), | ||
}) | ||
|
||
export type CreateFeedbackDto = z.infer<typeof CreateFeedbackDto> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
import { z } from 'zod' | ||
|
||
export enum QuestionType { | ||
BOOLEAN = 'boolean', | ||
TEXT = 'text', | ||
} | ||
|
||
export const CreateQuestionDto = z.object({ | ||
author: z.string().email(), | ||
groupId: z.string().min(1, { message: 'Group ID cannot be empty' }), | ||
title: z.string().min(10, { message: 'Title must be at least 10 characters long' }).includes('?', { | ||
message: 'Title must include a question mark', | ||
}), | ||
type: z.enum([QuestionType.BOOLEAN, QuestionType.TEXT]), | ||
}) | ||
|
||
export type CreateQuestionDto = z.infer<typeof CreateQuestionDto> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { z } from 'zod' | ||
import { QuestionType } from './create-question.dto' | ||
|
||
export const ToggleQuestionDto = z.object({ | ||
active: z.boolean(), | ||
questionId: z.number().positive(), | ||
type: z.enum([QuestionType.BOOLEAN, QuestionType.TEXT]), | ||
}) | ||
|
||
export type ToggleQuestionDto = z.infer<typeof ToggleQuestionDto> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.