Skip to content

Commit

Permalink
Merge pull request #13 from 51ngul4r1ty/issue/000487/fix-update-backl…
Browse files Browse the repository at this point in the history
…ogitem-status-numeric

Fix backlog item update stays in edit mode after save issue
  • Loading branch information
51ngul4r1ty authored Jan 25, 2024
2 parents 700ac4b + 78f524a commit c2f3f04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/web-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@atoll/web-app",
"version": "0.64.0",
"version": "0.64.1",
"description": "Atoll web app",
"scripts": {
"build": "npm run build-only && npm run build-deploy",
Expand Down
13 changes: 6 additions & 7 deletions packages/web-app/src/server/api/handlers/backlogItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,10 @@ export const backlogItemPutHandler = async (req: Request, res: Response) => {
newDataItem.unallocatedPoints = requestApiBacklogItem.estimate;
}
await backlogItem.update(newDataItem, { transaction });
const responseBacklogItem = mapApiItemToBacklogItem(backlogItem);
responseBacklogItem.storyEstimate = responseBacklogItem.estimate; // just updated the story estimate
responseBacklogItem.unallocatedPoints = responseBacklogItem.estimate; // all are in backlog
await handleResponseAndCommit(originalApiBacklogItem, responseBacklogItem, res, transaction);
const responseApiBacklogItem = mapDbToApiBacklogItem(backlogItem);
responseApiBacklogItem.storyEstimate = responseApiBacklogItem.estimate; // just updated the story estimate
responseApiBacklogItem.unallocatedPoints = responseApiBacklogItem.estimate; // all are in backlog
await handleResponseAndCommit(originalApiBacklogItem, responseApiBacklogItem, res, transaction);
}
} catch (err) {
const errLogContext = logger.warn(`handling error "${err}"`, [functionTag], logContext);
Expand Down Expand Up @@ -556,15 +556,14 @@ export const backlogItemJoinUnallocatedPartsPostHandler = async (req: Request, r

const handleResponseAndCommit = async (
originalApiBacklogItem: ApiBacklogItem,
backlogItem: BacklogItemDataModel,
apiBacklogItem: ApiBacklogItem,
res: Response,
transaction: Transaction
): Promise<void> => {
let sprintStats: ApiSprintStats;
const originalBacklogItem = mapApiItemToBacklogItem(originalApiBacklogItem);
if (transaction) {
await transaction.commit();
transaction = null;
}
respondWithItem(res, backlogItem, originalBacklogItem, sprintStats ? { sprintStats } : undefined);
respondWithItem(res, apiBacklogItem, originalApiBacklogItem, sprintStats ? { sprintStats } : undefined);
};

0 comments on commit c2f3f04

Please sign in to comment.