Skip to content

Commit

Permalink
Merge pull request #243 from OpenImaging/fix-types
Browse files Browse the repository at this point in the history
Fix typing on allUsers()
  • Loading branch information
dchiquito authored Dec 3, 2021
2 parents 68dd471 + 116b334 commit 7653f7f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/src/django.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ import OAuthClient from '@girder/oauth-client';
import { Project, Settings, User } from './types';
import { API_URL, OAUTH_API_ROOT, OAUTH_CLIENT_ID } from './constants';

interface Paginated<T> {
count: number,
next: string,
previous: string,
results: T[],
}

const apiClient = axios.create({ baseURL: API_URL });
const oauthClient = new OAuthClient(OAUTH_API_ROOT, OAUTH_CLIENT_ID);
const djangoClient = {
Expand Down Expand Up @@ -105,7 +112,7 @@ const djangoClient = {
const resp = await apiClient.get('/users/me');
return resp.status === 200 ? resp.data : null;
},
async allUsers(): Promise<Array<User>> {
async allUsers(): Promise<Paginated<User>> {
const resp = await apiClient.get('/users');
return resp.status === 200 ? resp.data : null;
},
Expand Down

0 comments on commit 7653f7f

Please sign in to comment.