From 20aad0eb116c4167254d56c883174932f270e635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=90=D0=BB=D0=B5=D0=BA?= =?UTF-8?q?=D1=81=D0=B0=D0=BD=D0=B4=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Thu, 10 Aug 2023 15:28:17 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D1=82=D1=80=D0=BE=D0=BB=D0=BB=D0=B5=D1=80=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudWebApi/Controllers/ManualController.cs | 4 +++- AsbCloudWebApi/Controllers/ManualFolderController.cs | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/AsbCloudWebApi/Controllers/ManualController.cs b/AsbCloudWebApi/Controllers/ManualController.cs index 1a05655d..e43f973a 100644 --- a/AsbCloudWebApi/Controllers/ManualController.cs +++ b/AsbCloudWebApi/Controllers/ManualController.cs @@ -1,6 +1,8 @@ +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Threading; using System.Threading.Tasks; +using AsbCloudApp.Data.Manuals; using AsbCloudApp.Repositories; using AsbCloudApp.Services; using Microsoft.AspNetCore.Http; @@ -101,7 +103,7 @@ public class ManualController : ControllerBase /// [HttpGet] [Permission] - [ProducesResponseType(typeof(int), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status403Forbidden)] public async Task GetCatalogAsync(CancellationToken cancellationToken) { diff --git a/AsbCloudWebApi/Controllers/ManualFolderController.cs b/AsbCloudWebApi/Controllers/ManualFolderController.cs index 076abe3c..fa97aef7 100644 --- a/AsbCloudWebApi/Controllers/ManualFolderController.cs +++ b/AsbCloudWebApi/Controllers/ManualFolderController.cs @@ -41,7 +41,7 @@ public class ManualFolderController : ControllerBase CancellationToken cancellationToken) { if (!CanUserAccess()) - Forbid(); + return Forbid(); return Ok(await manualCatalogService.AddFolderAsync(name, idParent, idCategory, cancellationToken)); } @@ -60,7 +60,7 @@ public class ManualFolderController : ControllerBase public async Task UpdateFolderAsync(int id, string name, CancellationToken cancellationToken) { if (!CanUserAccess()) - Forbid(); + return Forbid(); await manualCatalogService.UpdateFolderAsync(id, name, cancellationToken); @@ -80,7 +80,7 @@ public class ManualFolderController : ControllerBase public async Task DeleteFolderAsync(int id, CancellationToken cancellationToken) { if (!CanUserAccess()) - Forbid(); + return Forbid(); return Ok(await manualCatalogService.DeleteFolderAsync(id, cancellationToken)); }