mirror of
https://github.com/nikdoof/pocket-id.git
synced 2025-12-24 06:49:22 +00:00
feat: add sorting for tables
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import type { AuditLog } from '$lib/types/audit-log.type';
|
||||
import type { Paginated, PaginationRequest } from '$lib/types/pagination.type';
|
||||
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
|
||||
import APIService from './api-service';
|
||||
|
||||
class AuditLogService extends APIService {
|
||||
async list(pagination?: PaginationRequest) {
|
||||
async list(options?: SearchPaginationSortRequest) {
|
||||
const res = await this.api.get('/audit-logs', {
|
||||
params: pagination
|
||||
params: options
|
||||
});
|
||||
return res.data as Paginated<AuditLog>;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
import type { AuthorizeResponse, OidcClient, OidcClientCreate } from '$lib/types/oidc.type';
|
||||
import type { Paginated, PaginationRequest } from '$lib/types/pagination.type';
|
||||
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
|
||||
import APIService from './api-service';
|
||||
|
||||
class OidcService extends APIService {
|
||||
async authorize(clientId: string, scope: string, callbackURL: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string) {
|
||||
async authorize(
|
||||
clientId: string,
|
||||
scope: string,
|
||||
callbackURL: string,
|
||||
nonce?: string,
|
||||
codeChallenge?: string,
|
||||
codeChallengeMethod?: string
|
||||
) {
|
||||
const res = await this.api.post('/oidc/authorize', {
|
||||
scope,
|
||||
nonce,
|
||||
@@ -16,7 +23,14 @@ class OidcService extends APIService {
|
||||
return res.data as AuthorizeResponse;
|
||||
}
|
||||
|
||||
async authorizeNewClient(clientId: string, scope: string, callbackURL: string, nonce?: string, codeChallenge?: string, codeChallengeMethod?: string) {
|
||||
async authorizeNewClient(
|
||||
clientId: string,
|
||||
scope: string,
|
||||
callbackURL: string,
|
||||
nonce?: string,
|
||||
codeChallenge?: string,
|
||||
codeChallengeMethod?: string
|
||||
) {
|
||||
const res = await this.api.post('/oidc/authorize/new-client', {
|
||||
scope,
|
||||
nonce,
|
||||
@@ -29,12 +43,9 @@ class OidcService extends APIService {
|
||||
return res.data as AuthorizeResponse;
|
||||
}
|
||||
|
||||
async listClients(search?: string, pagination?: PaginationRequest) {
|
||||
async listClients(options?: SearchPaginationSortRequest) {
|
||||
const res = await this.api.get('/oidc/clients', {
|
||||
params: {
|
||||
search,
|
||||
...pagination
|
||||
}
|
||||
params: options
|
||||
});
|
||||
return res.data as Paginated<OidcClient>;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Paginated, PaginationRequest } from '$lib/types/pagination.type';
|
||||
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
|
||||
import type {
|
||||
UserGroupCreate,
|
||||
UserGroupWithUserCount,
|
||||
@@ -7,12 +7,9 @@ import type {
|
||||
import APIService from './api-service';
|
||||
|
||||
export default class UserGroupService extends APIService {
|
||||
async list(search?: string, pagination?: PaginationRequest) {
|
||||
async list(options?: SearchPaginationSortRequest) {
|
||||
const res = await this.api.get('/user-groups', {
|
||||
params: {
|
||||
search,
|
||||
...pagination
|
||||
}
|
||||
params: options
|
||||
});
|
||||
return res.data as Paginated<UserGroupWithUserCount>;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
import type { Paginated, PaginationRequest } from '$lib/types/pagination.type';
|
||||
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
|
||||
import type { User, UserCreate } from '$lib/types/user.type';
|
||||
import APIService from './api-service';
|
||||
|
||||
export default class UserService extends APIService {
|
||||
async list(search?: string, pagination?: PaginationRequest) {
|
||||
async list(options?: SearchPaginationSortRequest) {
|
||||
const res = await this.api.get('/users', {
|
||||
params: {
|
||||
search,
|
||||
...pagination
|
||||
}
|
||||
params: options
|
||||
});
|
||||
return res.data as Paginated<User>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user