public async Task <ActionResult <EnrolleeNotification> > CreateEnrolleeNotification(int enrolleeId, int adjudicatorNoteId, FromBodyData <int> assigneeId) { if (!await _enrolleeService.EnrolleeExistsAsync(enrolleeId)) { return(NotFound(ApiResponse.Message($"Enrollee not found with id {enrolleeId}"))); } var note = await _enrolleeService.GetEnrolleeAdjudicatorNoteAsync(enrolleeId, adjudicatorNoteId); if (note == null) { return(NotFound(ApiResponse.Message($"Enrollee note not found with id {adjudicatorNoteId}"))); } var admin = await _adminService.GetAdminAsync(User.GetPrimeUserId()); var notification = await _enrolleeService.CreateEnrolleeNotificationAsync(note.Id, admin.Id, assigneeId); return(Ok(ApiResponse.Result(notification))); }
public PostResponse CreateSomething([FromBody] FromBodyData data) { Debug.WriteLine($"Received counter value of {data.Counter}"); return(new PostResponse(PostResponse.ResponseStatus.Created, $"frombody/{data.Counter}")); }
public async Task <ActionResult <SiteNotification> > CreateSiteNotification(int siteId, int siteRegistrationNoteId, FromBodyData <int> assigneeId) { var site = await _siteService.GetSiteAsync(siteId); if (site == null) { return(NotFound(ApiResponse.Message($"Site not found with id {siteId}"))); } var note = await _siteService.GetSiteRegistrationNoteAsync(siteId, siteRegistrationNoteId); if (note == null) { return(NotFound(ApiResponse.Message($"Site Registration Note not found with id {siteRegistrationNoteId}"))); } var admin = await _adminService.GetAdminAsync(User.GetPrimeUserId()); var notification = await _siteService.CreateSiteNotificationAsync(note.Id, admin.Id, assigneeId); return(Ok(ApiResponse.Result(notification))); }
public PutResponse UpdateSomething([FromBody] FromBodyData data) { Debug.WriteLine($"Received counter value of {data.Counter}"); return(new PutResponse(PutResponse.ResponseStatus.OK)); }