elife-xpub icon indicating copy to clipboard operation
elife-xpub copied to clipboard

Save Team entities directly not through Manuscript relations

Open Cooryd opened this issue 5 years ago • 0 comments

Background

The Submission class contains a private function called _saveTeams, this assigns this.teams to this.manuscript.teams and then performs a a save on the manuscript to trigger a related save on the teams. This causes a save to occur on the manuscript row as well as the related team rows which is unneeded. We should be saving the team entities directly using the Team model, not the Manuscript.

See: https://github.com/elifesciences/elife-xpub/blob/233c862167c4ad090a1d792775848d462ee7e7c8/packages/component-submission/server/aggregates/Submission.js#L68

Cooryd avatar Jun 25 '19 09:06 Cooryd