Merge pull request #28 from rede5/codex/fix-undefined-dto.paginatedresponse-errors
Return API PaginatedResponse from ListUsers use case
This commit is contained in:
commit
ca599e7605
1 changed files with 4 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue