POST hogy tudjunk menteni is.

This commit is contained in:
2025-03-13 14:23:19 +01:00
parent a301a2a168
commit d2106514ba
4 changed files with 69 additions and 9 deletions
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Serilog;
using WorkFlowCheck.Common.DTO;
using WorkFlowCheck.Web.Services.Interfaces;
@@ -31,10 +32,21 @@ namespace WorkFlowCheck.Web.Pages.BaseStock.CheckPoints
CheckPoint = await _baseStockService.GetCheckPoint(id);
return new JsonResult(new { data = CheckPoint.CheckListTemplateRowDTO });
}
public async Task OnPostSave([FromBody] CheckPointDTO checkPointDTO)
public async Task<IActionResult> OnPostSave([FromBody] CheckPointDTO checkPointDTO)
{
int i = 0;
try
{
var result = await _baseStockService.UpdateCheckPoint(checkPointDTO);
return new JsonResult(new { success = true });
}
catch (Exception ex)
{
Log.Error(ex.Message);
}
return new JsonResult(new { success = false });
}
}
}