File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
server/claim/claim-revision Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -204,11 +204,11 @@ export class ClaimRevisionService {
204204 if ( sources && Array . isArray ( sources ) ) {
205205 for ( let source of sources ) {
206206 try {
207- const existingSource = await this . sourceService . findHref ( source ) ;
208- if ( existingSource && existingSource . length > 0 ) {
209- for ( let source of existingSource ) {
210- await this . sourceService . updateTargetId ( source . _id , claimId ) ;
211- }
207+ const existingSources = await this . sourceService . findHref ( source ) ;
208+ if ( existingSources && existingSources . length > 0 ) {
209+ await Promise . all ( existingSources . map ( source =>
210+ this . sourceService . updateTargetId ( source . _id , claimId )
211+ ) ) ;
212212 } else {
213213 await this . sourceService . create ( {
214214 href : source ,
You can’t perform that action at this time.
0 commit comments