Skip to content

Commit

Permalink
fix: schema (#1203)
Browse files Browse the repository at this point in the history
* fix: schema

* fix: make feedback optional

* chore: make feedback optional
  • Loading branch information
alexanderleegs authored Mar 11, 2024
1 parent a66c503 commit 85c560e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/routes/v2/authenticated/sites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class SitesRouter {
getPreviewInfo: RequestHandler<
{ siteName: string },
PreviewInfo[] | ResponseErrorBody,
{ sites: string[]; email: string },
{ sites: string[] },
never,
{ userSessionData: UserSessionData }
> = async (req, res) => {
Expand Down
2 changes: 1 addition & 1 deletion src/types/dto/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { UserType } from "../user"

export interface FeedbackDto {
rating: number
feedback: string
feedback?: string
email: string
userType: UserType
}
4 changes: 3 additions & 1 deletion src/validators/RequestSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@ const CreateCollaboratorRequestSchema = Joi.object().keys({

const CollateUserFeedbackRequestSchema = Joi.object().keys({
userType: Joi.string().valid(...Object.values(UserTypes)),
rating: Joi.number().required(),
feedback: Joi.string().optional(),
email: Joi.string().required(),
})

const CreateReviewRequestSchema = Joi.object().keys({
Expand All @@ -473,7 +476,6 @@ const LaunchSiteSchema = Joi.object().keys({

const GetPreviewInfoSchema = Joi.object().keys({
sites: Joi.array().items(Joi.string()).required(),
email: EmailSchema,
})

const VerifyEmailOtpSchema = Joi.object().keys({
Expand Down

0 comments on commit 85c560e

Please sign in to comment.