Skip to content

Commit

Permalink
add validation for proposal scientist comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mutambaraf committed Nov 20, 2024
1 parent aab90e0 commit 89149bc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/validation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@user-office-software/duo-validation",
"version": "5.1.8",
"version": "5.1.9",
"description": "Duo frontend and backend validation in one place.",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
17 changes: 17 additions & 0 deletions packages/validation/src/Proposal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,20 @@ export const generalInfoUpdateValidationSchema = Yup.object().shape({
.max(MAX_ABSTRACT_LEN, 'Abstract must be at most 1500 characters')
.required('Abstract is required'),
});

export const createProposalScientistCommentValidationSchema =
Yup.object().shape({
comment: Yup.string().min(1).required('Comment is required'),
proposalPk: Yup.number().required(),
});

export const updateProposalScientistCommentValidationSchema =
Yup.object().shape({
commentId: Yup.number().required(),
comment: Yup.string().min(1).required('Comment is required'),
});

export const deleteProposalScientistCommentValidationSchema =
Yup.object().shape({
commentId: Yup.number().required(),
});

0 comments on commit 89149bc

Please sign in to comment.