forked from baron/baron-sso
Biome 및 Go 포맷 적용
This commit is contained in:
@@ -43,13 +43,19 @@ export type AuditLog = {
|
||||
export type DevApiMockState = {
|
||||
clients: Client[];
|
||||
consents: Consent[];
|
||||
auditLogsByCursor?: Record<string, { items: AuditLog[]; next_cursor?: string }>;
|
||||
auditLogsByCursor?: Record<
|
||||
string,
|
||||
{ items: AuditLog[]; next_cursor?: string }
|
||||
>;
|
||||
auditLogs?: AuditLog[];
|
||||
onUpdateStatus?: (status: ClientStatus) => void;
|
||||
onRotateSecret?: (newSecret: string) => void;
|
||||
};
|
||||
|
||||
export function makeClient(id: string, overrides: Partial<Client> = {}): Client {
|
||||
export function makeClient(
|
||||
id: string,
|
||||
overrides: Partial<Client> = {},
|
||||
): Client {
|
||||
return {
|
||||
id,
|
||||
name: `${id} app`,
|
||||
@@ -301,7 +307,9 @@ export async function installDevApiMock(page: Page, state: DevApiMockState) {
|
||||
const status = searchParams.get("status") || "";
|
||||
const items = state.consents.filter((row) => {
|
||||
const matchesSubject =
|
||||
!subject || row.subject.includes(subject) || row.userName.includes(subject);
|
||||
!subject ||
|
||||
row.subject.includes(subject) ||
|
||||
row.userName.includes(subject);
|
||||
const matchesClientId = !clientId || row.clientId === clientId;
|
||||
const matchesStatus = !status || row.status === status;
|
||||
return matchesSubject && matchesClientId && matchesStatus;
|
||||
@@ -347,7 +355,8 @@ export async function installDevApiMock(page: Page, state: DevApiMockState) {
|
||||
};
|
||||
} catch {}
|
||||
const matchesAction = !action || parsedDetails.action === action;
|
||||
const matchesClient = !clientId || parsedDetails.target_id === clientId;
|
||||
const matchesClient =
|
||||
!clientId || parsedDetails.target_id === clientId;
|
||||
const matchesStatus = !status || item.status === status;
|
||||
return matchesAction && matchesClient && matchesStatus;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user