mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-22 21:11:14 +00:00
fix(packing): take a bringer off in one transaction, and settle the last baselines
Clearing a common item's owner and dropping the bringer row now happen inside one unit of work, so a failure cannot leave one without the other. The lint and RTL baselines follow the rows that lost their last physical sides.
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
},
|
||||
"tests": {
|
||||
"@typescript-eslint/no-explicit-any": 489,
|
||||
"@typescript-eslint/no-non-null-assertion": 1877,
|
||||
"@typescript-eslint/no-non-null-assertion": 1876,
|
||||
"@typescript-eslint/no-misused-promises": 22,
|
||||
"@typescript-eslint/no-unused-vars": 51,
|
||||
"@typescript-eslint/no-floating-promises": 33,
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
"components/PDF/tripMapImage.ts": 1,
|
||||
"components/Packing/PackingListPanelBagCard.tsx": 1,
|
||||
"components/Packing/PackingListPanelCategoryGroup.tsx": 3,
|
||||
"components/Packing/PackingListPanelItemRow.tsx": 2,
|
||||
"components/Planner/DayDetailPanel.tsx": 1,
|
||||
"components/Planner/PlaceInspector.tsx": 1,
|
||||
"components/Planner/TransitSearchPanel.tsx": 3,
|
||||
|
||||
@@ -422,8 +422,10 @@ export class PackingService {
|
||||
if (!item) return null;
|
||||
// On a Common item the owner is its first bringer, so taking them off the
|
||||
// item has to clear the owner too; otherwise their avatar stuck for good (#3098).
|
||||
if (item.is_private === 0 && item.owner_id === userId) await this.itemsRepo.clearOwner(id);
|
||||
await this.contributorsRepo.deleteOne(id, userId);
|
||||
await this.uow.transactional(async () => {
|
||||
if (item.is_private === 0 && item.owner_id === userId) await this.itemsRepo.clearOwner(id);
|
||||
await this.contributorsRepo.deleteOne(id, userId);
|
||||
});
|
||||
return (await this.enrichItems([await this.itemsRepo.findById(id)]))[0];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user