forked from ddrilling/AsbCloudServer
Фикс: проверка ключа скважины в методе контроллера, а не в свойсте класса (т.к. на этом падал фронтенд)
This commit is contained in:
parent
ab280f3451
commit
7b8506e44d
@ -16,7 +16,6 @@ namespace AsbCloudApp.Data
|
|||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
[Required]
|
[Required]
|
||||||
[Range(1, int.MaxValue, ErrorMessage = "Id скважины не может быть меньше 1")]
|
|
||||||
public int IdWell { get; set; }
|
public int IdWell { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Http;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -199,7 +200,9 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Permission]
|
[Permission]
|
||||||
[ProducesResponseType(typeof(IEnumerable<WellOperationDto>), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(IEnumerable<WellOperationDto>), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public async Task<IActionResult> InsertRangeAsync(int idWell, [FromBody] IEnumerable<WellOperationDto> values,
|
public async Task<IActionResult> InsertRangeAsync(
|
||||||
|
[Range(1, int.MaxValue, ErrorMessage = "Id скважины не может быть меньше 1")] int idWell,
|
||||||
|
[FromBody] IEnumerable<WellOperationDto> values,
|
||||||
CancellationToken token)
|
CancellationToken token)
|
||||||
{
|
{
|
||||||
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
|
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
|
||||||
|
Loading…
Reference in New Issue
Block a user