Skip to content

Commit

Permalink
Update versions.save() to return finalVersionDelta
Browse files Browse the repository at this point in the history
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
  • Loading branch information
licitdev and paescuj committed Jun 5, 2024
1 parent 4fed821 commit 1c529f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions api/src/controllers/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,7 @@ router.post(

const mainItem = await service.getMainItem(version['collection'], version['item']);

await service.save(req.params['pk']!, req.body);

const updatedVersion = await service.readOne(req.params['pk']!);
const updatedVersion = await service.save(req.params['pk']!, req.body);

const result = assign(mainItem, updatedVersion['delta']);

Expand Down
2 changes: 1 addition & 1 deletion api/src/services/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export class VersionsService extends ItemsService {
cache.clear();
}

return data;
return finalVersionDelta;
}

async promote(version: PrimaryKey, mainHash: string, fields?: string[]) {
Expand Down

0 comments on commit 1c529f8

Please sign in to comment.