Refactor User Management API and Update Documentation
- Changed API tags from "Admin-Users" to "Admin-Authorization" for better clarity in user management endpoints. - Removed unused endpoints for retrieving users by company ID and role, streamlining the user management functionality. - Updated user entity and forms to reflect new example values for improved clarity in API documentation. - Enhanced pagination handling in user listing responses, ensuring consistent metadata structure. - Updated API documentation to reflect changes in endpoint structure and response formats, improving clarity for API consumers.
This commit is contained in:
+8
-4
@@ -279,20 +279,24 @@ func (pb *PaginationBuilder) Cursor(cursor string) *PaginationBuilder {
|
||||
}
|
||||
|
||||
// SortBy sets the sort field and order
|
||||
func (pb *PaginationBuilder) SortBy(field string, order int) *PaginationBuilder {
|
||||
func (pb *PaginationBuilder) SortBy(field string, order string) *PaginationBuilder {
|
||||
pb.pagination.SortField = field
|
||||
pb.pagination.SortOrder = order
|
||||
if order == "asc" {
|
||||
pb.pagination.SortOrder = 1
|
||||
} else {
|
||||
pb.pagination.SortOrder = -1
|
||||
}
|
||||
return pb
|
||||
}
|
||||
|
||||
// SortAsc sorts in ascending order
|
||||
func (pb *PaginationBuilder) SortAsc(field string) *PaginationBuilder {
|
||||
return pb.SortBy(field, 1)
|
||||
return pb.SortBy(field, "asc")
|
||||
}
|
||||
|
||||
// SortDesc sorts in descending order
|
||||
func (pb *PaginationBuilder) SortDesc(field string) *PaginationBuilder {
|
||||
return pb.SortBy(field, -1)
|
||||
return pb.SortBy(field, "desc")
|
||||
}
|
||||
|
||||
// Build returns the final pagination options
|
||||
|
||||
Reference in New Issue
Block a user