public async Task <IActionResult> DeleteReport([FromQuery] DeleteReportRequest request) { var response = await mediator.Send(request); logger.LogResponse($"User #{HttpContext.GetCurrentUserId()} deleted report #{request.ReportId}", response.Error); return(this.CreateResponse(response)); }
public BaseResponse DeleteReport(DeleteReportRequest request) { return(GetResponse(() => { var response = new BaseResponse(); try { using (FamilyFinanceContext db = new FamilyFinanceContext()) { var report = db.Reports.Where(x => x.Id == request.ReportId && x.FamilyId == request.FamilyId).FirstOrDefault(); db.Reports.Remove(report); db.SaveChanges(); } } catch { response.BaseIsSuccess = false; response.BaseMessage = Shared.Constants.BAD_REQUEST; } return response; })); }
public BaseResponse DeleteReportById([FromBody] DeleteReportRequest request) => _reportService.DeleteReport(request);
public async Task <IActionResult> DeleteReport(DeleteReportRequest request) { await _workspaceService.DeleteReportAsync(request.GroupId, request.ReportId); return(Ok()); }
public async Task <BaseResponse> DeleteReportAsync(DeleteReportRequest request) => await TryCallApiAsync <BaseResponse>("reports/delete_report", request);