コード例 #1
0
ファイル: SupportController.cs プロジェクト: TomeQ2k/_Smile
        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));
        }
コード例 #2
0
        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;
            }));
        }
コード例 #3
0
 public BaseResponse DeleteReportById([FromBody] DeleteReportRequest request) =>
 _reportService.DeleteReport(request);
コード例 #4
0
        public async Task <IActionResult> DeleteReport(DeleteReportRequest request)
        {
            await _workspaceService.DeleteReportAsync(request.GroupId, request.ReportId);

            return(Ok());
        }
コード例 #5
0
 public async Task <BaseResponse> DeleteReportAsync(DeleteReportRequest request) =>
 await TryCallApiAsync <BaseResponse>("reports/delete_report", request);