Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds missing pagination-related fields to users endpoint #3698

Merged
merged 2 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/dispatch/auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,14 @@
response_model=UserPagination,
)
def get_users(organization: OrganizationSlug, common: CommonParameters):
"""Get all users."""
"""Gets all organization users."""
common["filter_spec"] = {
"and": [{"model": "Organization", "op": "==", "field": "slug", "value": organization}]
}

items = search_filter_sort_paginate(model="DispatchUser", **common)

# filtered users
return {
"total": items["total"],
"items": [
{
"id": u.id,
Expand All @@ -70,6 +68,9 @@ def get_users(organization: OrganizationSlug, common: CommonParameters):
}
for u in items["items"]
],
"itemsPerPage": items["itemsPerPage"],
"page": items["page"],
"total": items["total"],
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
:loading="loading"
loading-text="Loading... Please wait"
>
<template v-slot:item.data-table-actions="{ item }">
<template #[`item.data-table-actions`]="{ item }">
<v-menu bottom left>
<template v-slot:activator="{ on }">
<template #activator="{ on }">
<v-btn icon v-on="on">
<v-icon>mdi-dots-vertical</v-icon>
</v-btn>
Expand Down