Skip to content

Commit

Permalink
refactor: Update ActivityRepo and UpdateUsersActivityUsecase to toggl…
Browse files Browse the repository at this point in the history
…e user status
  • Loading branch information
FelipeCarillo committed Jun 9, 2024
1 parent 84bce6e commit 7b8bb04
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ export class ActivityRepo implements IActivityRepo {

users.forEach(async user => {
const response_user = await ActivityApplication.update({
status: user.status
status: !user.status
}, {
where: {
[Op.and]: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@ export class UpdateUsersActivityUsecase {
throw new NotfoundError("Applicants not found");
}

applicants_db.forEach((applicant: { user_id: string, status: boolean }) => {
return {
user_id: applicant.user_id,
status: !applicant.status,
};
});

const updateStatusResult = await this.activity_repo.update_users_activity_status(body.activity_id, body.applicants);
if (!updateStatusResult) {
throw new ConflictError("Error updating activity status");
Expand Down

0 comments on commit 7b8bb04

Please sign in to comment.