Skip to content

Commit

Permalink
Update user-experience.service.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
RiXelanya committed Nov 15, 2023
1 parent c0ce862 commit 107fa8f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/services/user-experience.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,11 @@ export class UserExperienceService {
jobs.push(this.userExperienceRepository.deleteAll(where));
}

if (editors && !editors.includes(userId)) {
if (editors) {
if (editors.includes(userId)) {
jobs.push(this.experienceRepository.editors(id).unlinkAll())
}
else {
await this.experienceRepository.editors(id).unlinkAll();
editors.map(editor => {
const link = this.experienceRepository
Expand All @@ -269,7 +273,7 @@ export class UserExperienceService {
jobs.push(creation);
return editor;
});

}
}

Promise.all(jobs) as Promise<AnyObject>;
Expand Down

0 comments on commit 107fa8f

Please sign in to comment.