Skip to content

Commit

Permalink
Story/000213/fix backlogitem edit issue (#214)
Browse files Browse the repository at this point in the history
* implemented validation for status

* bump ver

* fix backlog item status update issue

Co-authored-by: Kevin <[email protected]>
  • Loading branch information
51ngul4r1ty and singularity15 authored Dec 6, 2020
1 parent 4d399cc commit 2bd336b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "atoll",
"version": "0.26.0",
"version": "0.26.1",
"author": {
"name": "Kevin Berry",
"email": "[email protected]"
Expand Down Expand Up @@ -57,7 +57,7 @@
"setup": "ts-node ./scripts/setup.ts"
},
"dependencies": {
"@atoll/shared": "0.26.0",
"@atoll/shared": "0.26.1",
"@flopflip/memory-adapter": "1.6.0",
"@flopflip/react-broadcast": "10.1.11",
"axios": "0.19.2",
Expand Down
9 changes: 8 additions & 1 deletion src/server/api/handlers/backlogItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as HttpStatus from "http-status-codes";
import { CreateOptions, Transaction } from "sequelize";

// libraries
import { ApiBacklogItem, ApiBacklogItemRank } from "@atoll/shared";
import { getValidStatuses, isValidStatus, ApiBacklogItem, ApiBacklogItemRank } from "@atoll/shared";

// data access
import {
Expand Down Expand Up @@ -308,6 +308,13 @@ export const backlogItemPutHandler = async (req: Request, res: Response) => {
);
return;
}
if (!isValidStatus(req.body.status)) {
respondWithFailedValidation(
res,
`Status "${req.body.status}" is not a valid value - it should be one of the following: ${getValidStatuses().join(", ")}`
);
return;
}
try {
const backlogItem = await BacklogItemModel.findOne({
where: { id: bodyItemId }
Expand Down

0 comments on commit 2bd336b

Please sign in to comment.