POST hogy tudjunk menteni is.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Serilog;
|
||||
using WorkFlowCheck.BL.Services;
|
||||
using WorkFlowCheck.BL.Services.Interfaces;
|
||||
using WorkFlowCheck.Common.DTO;
|
||||
@@ -14,7 +15,7 @@ namespace WorkFlowCheck.API.Controllers
|
||||
{
|
||||
_syncService = syncService;
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("GetAllCheckPoints")]
|
||||
public async Task<ApiResponseDTO<List<CheckPointDTO>>> GetAllCheckpointsAsync()
|
||||
{
|
||||
@@ -26,9 +27,9 @@ namespace WorkFlowCheck.API.Controllers
|
||||
|
||||
if (checkPointListDTO != null)
|
||||
{
|
||||
|
||||
retVal.IsSuccess = true;
|
||||
retVal.Data = checkPointListDTO;
|
||||
|
||||
retVal.IsSuccess = true;
|
||||
retVal.Data = checkPointListDTO;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -38,7 +39,7 @@ namespace WorkFlowCheck.API.Controllers
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("GetCheckPoints/{id}")]
|
||||
public async Task<ApiResponseDTO<CheckPointDTO>> GetAllCheckpointsAsync(int id)
|
||||
{
|
||||
@@ -134,5 +135,27 @@ namespace WorkFlowCheck.API.Controllers
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
[HttpPost("authenticate")]
|
||||
public async Task<ApiResponseDTO<CheckPointDTO>> UpdateCheckPoint([FromBody] CheckPointDTO checkPointDTO)
|
||||
{
|
||||
var retVal = new ApiResponseDTO<CheckPointDTO>()
|
||||
{
|
||||
IsSuccess = true
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
var result = await _syncService.UpdateCheckPointAsync(checkPointDTO);
|
||||
retVal.Data = result;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
retVal.IsSuccess = false;
|
||||
Log.Error(ex.Message);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user