Фикс контроллеров

This commit is contained in:
parent 5d4805dd22
commit 20aad0eb11
2 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,8 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using AsbCloudApp.Data.Manuals;
using AsbCloudApp.Repositories; using AsbCloudApp.Repositories;
using AsbCloudApp.Services; using AsbCloudApp.Services;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
@ -101,7 +103,7 @@ public class ManualController : ControllerBase
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
[Permission] [Permission]
[ProducesResponseType(typeof(int), StatusCodes.Status200OK)] [ProducesResponseType(typeof(IEnumerable<CatalogItemManualDto>), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status403Forbidden)] [ProducesResponseType(StatusCodes.Status403Forbidden)]
public async Task<IActionResult> GetCatalogAsync(CancellationToken cancellationToken) public async Task<IActionResult> GetCatalogAsync(CancellationToken cancellationToken)
{ {

View File

@ -41,7 +41,7 @@ public class ManualFolderController : ControllerBase
CancellationToken cancellationToken) CancellationToken cancellationToken)
{ {
if (!CanUserAccess()) if (!CanUserAccess())
Forbid(); return Forbid();
return Ok(await manualCatalogService.AddFolderAsync(name, idParent, idCategory, cancellationToken)); return Ok(await manualCatalogService.AddFolderAsync(name, idParent, idCategory, cancellationToken));
} }
@ -60,7 +60,7 @@ public class ManualFolderController : ControllerBase
public async Task<IActionResult> UpdateFolderAsync(int id, string name, CancellationToken cancellationToken) public async Task<IActionResult> UpdateFolderAsync(int id, string name, CancellationToken cancellationToken)
{ {
if (!CanUserAccess()) if (!CanUserAccess())
Forbid(); return Forbid();
await manualCatalogService.UpdateFolderAsync(id, name, cancellationToken); await manualCatalogService.UpdateFolderAsync(id, name, cancellationToken);
@ -80,7 +80,7 @@ public class ManualFolderController : ControllerBase
public async Task<IActionResult> DeleteFolderAsync(int id, CancellationToken cancellationToken) public async Task<IActionResult> DeleteFolderAsync(int id, CancellationToken cancellationToken)
{ {
if (!CanUserAccess()) if (!CanUserAccess())
Forbid(); return Forbid();
return Ok(await manualCatalogService.DeleteFolderAsync(id, cancellationToken)); return Ok(await manualCatalogService.DeleteFolderAsync(id, cancellationToken));
} }