mirror of
https://github.com/docmost/docmost.git
synced 2026-05-19 16:04:17 +08:00
78b1c1a453
* add cursor pagination function * support custom order modifier * refactor returned object * feat(db): migrate paginated endpoints to cursor-based pagination * sync * support hasPrevPage boolean * feat(client): migrate pagination from offset to cursor-based * support beforeCursor/prevCursor * wrap search results in items array for API consistency
34 lines
994 B
TypeScript
34 lines
994 B
TypeScript
import api from "@/lib/api-client.ts";
|
|
import { IAuthProvider } from "@/ee/security/types/security.types.ts";
|
|
import { IPagination } from "@/lib/types.ts";
|
|
|
|
export async function getSsoProviderById(data: {
|
|
providerId: string;
|
|
}): Promise<any> {
|
|
const req = await api.post<IAuthProvider>("/sso/info");
|
|
return req.data;
|
|
}
|
|
|
|
export async function getSsoProviders(): Promise<IPagination<IAuthProvider>> {
|
|
const req = await api.post<IPagination<IAuthProvider>>("/sso/providers");
|
|
return req.data;
|
|
}
|
|
|
|
export async function createSsoProvider(data: any): Promise<IAuthProvider> {
|
|
const req = await api.post<IAuthProvider>("/sso/create", data);
|
|
return req.data;
|
|
}
|
|
|
|
export async function deleteSsoProvider(data: {
|
|
providerId: string;
|
|
}): Promise<void> {
|
|
await api.post<any>("/sso/delete", data);
|
|
}
|
|
|
|
export async function updateSsoProvider(
|
|
data: Partial<IAuthProvider>,
|
|
): Promise<IAuthProvider> {
|
|
const req = await api.post<IAuthProvider>("/sso/update", data);
|
|
return req.data;
|
|
}
|