Skip to content

Commit

Permalink
fix: access request db error
Browse files Browse the repository at this point in the history
  • Loading branch information
ychung-mot committed Apr 11, 2024
1 parent a3b86bb commit 4ad2675
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server/StrDss.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,6 @@

// make sure this is after app.UseHangfireDashboard()
//RecurringJob.AddOrUpdate<HangfireJobs>("Process Rental Listing Report", job => job.ProcessRentalListingReport(), "*/1 * * * *");
RecurringJob.AddOrUpdate<HangfireJobs>("Process Takedown Request Batch Emails", job => job.ProcessTakedownRequestBatchEmails(), "50 15 * * *"); //UTC time 23:50
//RecurringJob.AddOrUpdate<HangfireJobs>("Process Takedown Request Batch Emails", job => job.ProcessTakedownRequestBatchEmails(), "50 15 * * *"); //UTC time 23:50

app.Run();
12 changes: 9 additions & 3 deletions server/StrDss.Service/UserService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,13 @@ public async Task<Dictionary<string, List<string>>> CreateAccessRequestAsync(Acc
await _userRepo.UpdateUserAsync(userDto);
}

var dbContext = _unitOfWork.GetDbContext();

using var transaction = dbContext.Database.BeginTransaction();

_unitOfWork.Commit();

var user = _userRepo.GetUserByGuid(_currentUser.UserGuid);
var user = await _userRepo.GetUserByGuid(_currentUser.UserGuid);

var adminUsers = await _userRepo.GetAdminUsers();

Expand Down Expand Up @@ -146,8 +150,8 @@ public async Task<Dictionary<string, List<string>>> CreateAccessRequestAsync(Acc
CcEmailAddressDsc = null,
UnreportedListingUrl = null,
LgStrBylawUrl = null,
InitiatingUserIdentityId = _currentUser.Id,
AffectedByUserIdentityId = user.Id,
InitiatingUserIdentityId = user!.UserIdentityId,
AffectedByUserIdentityId = user!.UserIdentityId,
InvolvedInOrganizationId = null
};

Expand All @@ -158,6 +162,8 @@ public async Task<Dictionary<string, List<string>>> CreateAccessRequestAsync(Acc
_unitOfWork.Commit();
}

transaction.Commit();

return errors;
}

Expand Down

0 comments on commit 4ad2675

Please sign in to comment.