Skip to content

Commit

Permalink
Merge pull request #204 from UserOfficeProject/add-proposal-scientist…
Browse files Browse the repository at this point in the history
…-comment

feat: add validation for proposal scientist comment
  • Loading branch information
mutambaraf authored Nov 20, 2024
2 parents aab90e0 + 89149bc commit 4b2a921
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 4b2a921

Please sign in to comment.