UPDATE: Something with module search
All checks were successful
Build and Release / release (push) Successful in 1m25s

This commit is contained in:
2026-04-07 17:45:39 +07:00
parent 2d36004ac7
commit 677ae95c8f
11 changed files with 177 additions and 248 deletions

View File

@@ -213,6 +213,18 @@ func (u *userService) SearchUser(ctx context.Context, dto *request.SearchUserDto
Limit: int32(dto.Limit + 1),
}
if dto.Sort != "" {
arg.Sort = pgtype.Text{String: dto.Sort, Valid: true}
} else {
arg.Sort = pgtype.Text{String: "id", Valid: true}
}
if dto.Order != "" {
arg.Order = pgtype.Text{String: dto.Order, Valid: true}
} else {
arg.Order = pgtype.Text{String: "asc", Valid: true}
}
if dto.Cursor != "" {
pgID, err := convert.StringToUUID(dto.Cursor)
if err != nil {
@@ -259,11 +271,14 @@ func (u *userService) SearchUser(ctx context.Context, dto *request.SearchUserDto
rows = rows[:dto.Limit]
}
users := models.UsersEntityToResponse(rows)
res := &response.PaginatedResponse{
Data: rows,
Data: users,
Status: true,
Message: "",
}
res.Pagination.HasMore = hasMore
res.Pagination.NextCursor = nextCursor