Merge pull request #28 from rede5/codex/fix-undefined-dto.paginatedresponse-errors

Return API PaginatedResponse from ListUsers use case
This commit is contained in:
Tiago Yamamoto 2025-12-22 20:44:36 -03:00 committed by GitHub
commit ca599e7605
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,6 +5,7 @@ import (
"github.com/rede5/gohorsejobs/backend/internal/core/dto"
"github.com/rede5/gohorsejobs/backend/internal/core/ports"
apidto "github.com/rede5/gohorsejobs/backend/internal/dto"
)
type ListUsersUseCase struct {
@ -17,7 +18,7 @@ func NewListUsersUseCase(uRepo ports.UserRepository) *ListUsersUseCase {
}
}
func (uc *ListUsersUseCase) Execute(ctx context.Context, tenantID string, page, limit int) (*dto.PaginatedResponse, error) {
func (uc *ListUsersUseCase) Execute(ctx context.Context, tenantID string, page, limit int) (*apidto.PaginatedResponse, error) {
if page <= 0 {
page = 1
}
@ -54,9 +55,9 @@ func (uc *ListUsersUseCase) Execute(ctx context.Context, tenantID string, page,
})
}
return &dto.PaginatedResponse{
return &apidto.PaginatedResponse{
Data: response,
Pagination: dto.Pagination{
Pagination: apidto.Pagination{
Page: page,
Limit: limit,
Total: total,