Require auth for Excel import

This commit is contained in:
Eduardo Lopes 2026-02-02 15:26:21 -03:00
parent 67087bce1f
commit fa669f9332
1 changed files with 2 additions and 0 deletions

View File

@ -3,6 +3,7 @@ using line_gestao_api.Data;
using line_gestao_api.Dtos; using line_gestao_api.Dtos;
using line_gestao_api.Models; using line_gestao_api.Models;
using line_gestao_api.Services; using line_gestao_api.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
@ -503,6 +504,7 @@ namespace line_gestao_api.Controllers
// ✅ 8. IMPORT EXCEL // ✅ 8. IMPORT EXCEL
// ========================================================== // ==========================================================
[HttpPost("import-excel")] [HttpPost("import-excel")]
[Authorize]
[Consumes("multipart/form-data")] [Consumes("multipart/form-data")]
[RequestSizeLimit(50_000_000)] [RequestSizeLimit(50_000_000)]
public async Task<ActionResult<ImportResultDto>> ImportExcel([FromForm] ImportExcelForm form) public async Task<ActionResult<ImportResultDto>> ImportExcel([FromForm] ImportExcelForm form)