Spaces:
Paused
Paused
File size: 748 Bytes
0b9dc2e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | import { client } from './client';
import type {
CreateCredentialRequest,
CreateCredentialResponse,
CredentialListResponse,
CredentialRecord,
CredentialSchemasResponse,
UpdateCredentialRequest,
} from './types';
export const credentialApi = {
list: () => client.get<CredentialListResponse>('/credential/'),
schemas: () => client.get<CredentialSchemasResponse>('/credential/schemas'),
create: (body: CreateCredentialRequest) =>
client.post<CreateCredentialResponse>('/credential/', body),
update: (credentialId: string, body: UpdateCredentialRequest) =>
client.patch<CredentialRecord>(`/credential/${credentialId}`, body),
delete: (credentialId: string) => client.delete(`/credential/${credentialId}`),
};
|