Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
51ngul4r1ty committed Jan 25, 2024
1 parent 6018dae commit 5a541d1
Showing 1 changed file with 6 additions and 7 deletions.
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 5a541d1

Please sign in to comment.