Implemented signalR in project infrastructure APIs
This commit is contained in:
parent
f47586710b
commit
793877b8f8
@ -562,7 +562,13 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
Activity = attendance.Activity,
|
Activity = attendance.Activity,
|
||||||
JobRoleName = employee.JobRole.Name
|
JobRoleName = employee.JobRole.Name
|
||||||
};
|
};
|
||||||
await _signalR.Clients.All.SendAsync("Attendance", new { LoggedInUserId = currentEmployee.Id, ProjectId = recordAttendanceDot.ProjectID, Response = vm });
|
var sendActivity = 0;
|
||||||
|
if (recordAttendanceDot.Id == Guid.Empty)
|
||||||
|
{
|
||||||
|
sendActivity = 1;
|
||||||
|
}
|
||||||
|
var notification = new { LoggedInUserId = currentEmployee.Id, Keyword = "Attendance", Activity = sendActivity, ProjectId = attendance.ProjectID, Response = vm };
|
||||||
|
await _signalR.Clients.All.SendAsync("NotificationEventHandler", notification);
|
||||||
_logger.LogInfo("Attendance for employee {FirstName} {LastName} has been marked", employee.FirstName ?? string.Empty, employee.LastName ?? string.Empty);
|
_logger.LogInfo("Attendance for employee {FirstName} {LastName} has been marked", employee.FirstName ?? string.Empty, employee.LastName ?? string.Empty);
|
||||||
return Ok(ApiResponse<object>.SuccessResponse(vm, "Attendance marked successfully.", 200));
|
return Ok(ApiResponse<object>.SuccessResponse(vm, "Attendance marked successfully.", 200));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user