fixed user access issue.

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-02-09 10:34:01 -07:00
parent 9fe0396abe
commit c4dc81e4bc
6 changed files with 222 additions and 7 deletions

View File

@@ -48,6 +48,12 @@ namespace CarCareTracker.Logic
if (existingUser.Id != default)
{
//user exists.
//check if user is already a collaborator
var userAccess = _userAccess.GetUserAccessByVehicleAndUserId(existingUser.Id, vehicleId);
if (userAccess != null)
{
return new OperationResponse { Success = false, Message = "User is already a collaborator" };
}
var result = AddUserAccessToVehicle(existingUser.Id, vehicleId);
if (result)
{