CheckListRow edit

This commit is contained in:
2025-03-28 17:35:29 +01:00
parent 728b6a8a9e
commit 77796f3247
7 changed files with 286 additions and 1 deletions
@@ -221,5 +221,49 @@ namespace WorkFlowCheck.API.Controllers
}
return retVal;
}
[HttpGet("GetCheckListRow/{id}")]
public async Task<ApiResponseDTO<CheckListRowDTO>> GetCheckListRow(int id)
{
var retVal = new ApiResponseDTO<CheckListRowDTO>()
{
IsSuccess = true,
};
var checkListRowDTO = await _checkListService.GetCheckListRowAsync(id);
if (checkListRowDTO != null)
{
retVal.IsSuccess = true;
retVal.Data = checkListRowDTO;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
public async Task<ApiResponseDTO<CheckListRowDTO>> UpdateCheckListRow([FromBody] CheckListRowDTO CheckListRowDTO)
{
var retVal = new ApiResponseDTO<CheckListRowDTO>()
{
IsSuccess = true
};
try
{
var result = await _checkListService.UpdateCheckListRowAsync(CheckListRowDTO);
retVal.Data = result;
}
catch (Exception ex)
{
retVal.IsSuccess = false;
Log.Error(ex.Message);
}
return retVal;
}
}
}