Controller javítása userId-vel

This commit is contained in:
2025-03-22 14:19:00 +01:00
parent 3a4db4dd14
commit d55dee91e9
4 changed files with 78 additions and 17 deletions
@@ -3,6 +3,7 @@ using Serilog;
using WorkFlowCheck.BL.Services;
using WorkFlowCheck.BL.Services.Interfaces;
using WorkFlowCheck.Common.DTO;
using WorkFlowCheck.DL.Entities;
namespace WorkFlowCheck.API.Controllers
{
@@ -225,14 +226,37 @@ namespace WorkFlowCheck.API.Controllers
}
[HttpGet("GetAllCheckListTemplateHeader")]
public async Task<ApiResponseDTO<List<CheckListTemplateHeaderDTO>>> GetAllCheckListTemplateHeaderAsync()
[HttpGet("GetAllCheckListTemplateHeader/{userId}")]
public async Task<ApiResponseDTO<List<CheckListTemplateHeaderDTO>>> GetAllCheckListTemplateHeaderAsync(int userId)
{
var retVal = new ApiResponseDTO<List<CheckListTemplateHeaderDTO>>()
{
IsSuccess = true,
};
var response = await _syncService.GetAllCheckListTemplateAsync();
var response = await _syncService.GetAllCheckListTemplateAsync(userId);
if (response != null)
{
retVal.IsSuccess = true;
retVal.Data = response;
}
else
{
retVal.IsSuccess = false;
retVal.Errors.Add("No data!");
}
return retVal;
}
[HttpGet("GetAllCheckListHeader/{userId}")]
public async Task<ApiResponseDTO<List<CheckListHeaderDTO>>> GetAllCheckListHeaderAsync(int userId)
{
var retVal = new ApiResponseDTO<List<CheckListHeaderDTO>>()
{
IsSuccess = true,
};
var response = await _syncService.GetAllCheckListAsync(userId);
if (response != null)
{
@@ -249,10 +273,10 @@ namespace WorkFlowCheck.API.Controllers
return retVal;
}
}
}