Mentés + JwtMiddleware-ből a dolgok berakva
This commit is contained in:
@@ -16,9 +16,7 @@
|
||||
<div class="card shadow p-4">
|
||||
<form method="post" id="checkPointForm">
|
||||
<meta name="csrf-token" content="@Antiforgery.GetAndStoreTokens(HttpContext).RequestToken" />
|
||||
|
||||
<input type="hidden" id="hiddenCheckPointId" value="@Model.CheckPoint.Id" />
|
||||
|
||||
<input type="hidden" asp-for="CheckPoint.Id" />
|
||||
<div class="mb-3">
|
||||
<label asp-for="CheckPoint.ShortName"></label>
|
||||
<input asp-for="CheckPoint.ShortName" class="form-control" />
|
||||
@@ -108,9 +106,6 @@
|
||||
$("#saveCheckPoint").click(function () {
|
||||
const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
|
||||
var formData = getFormAsNestedObject('#checkPointForm');
|
||||
|
||||
console.log(formData);
|
||||
console.log(JSON.stringify(formData.CheckPoint));
|
||||
|
||||
$.ajax({
|
||||
url: $('#checkPointEditPostUrl').val(),
|
||||
|
||||
@@ -35,11 +35,17 @@ namespace WorkFlowCheck.Web.Pages.BaseStock.CheckPoints
|
||||
|
||||
public async Task<IActionResult> OnPostSave([FromBody] CheckPointDTO checkPointDTO)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
var result = await _baseStockService.UpdateCheckPoint(checkPointDTO);
|
||||
return new JsonResult(new { success = true });
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
return new JsonResult(new { success = true });
|
||||
}
|
||||
else
|
||||
{
|
||||
return new JsonResult(new { success = false });
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user