AcadeDoc/apps/client/src/features/acadenice/api-keys/services/api-key.service.ts
Corentin 9dd283ced6 refactor(acadedoc): rename API routes /api/acadenice -> /api/v1 — R5.1
Replace all @Controller('acadenice/...') decorators with 'v1/...' on 16 NestJS controllers. Update all client services, hooks, tests, extension-clipper, and doc comments to match. DB table names (acadenice_*) and folder structure untouched.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 14:52:49 +02:00

22 lines
627 B
TypeScript

import api from "@/lib/api-client";
import {
AcadeniceApiKey,
CreateAcadeniceApiKeyRequest,
CreateAcadeniceApiKeyResponse,
} from "../types/api-key.types";
export async function listAcadeniceApiKeys(): Promise<AcadeniceApiKey[]> {
const resp = await api.get("/v1/api-keys");
return resp.data;
}
export async function createAcadeniceApiKey(
data: CreateAcadeniceApiKeyRequest,
): Promise<CreateAcadeniceApiKeyResponse> {
const resp = await api.post("/v1/api-keys", data);
return resp.data;
}
export async function revokeAcadeniceApiKey(id: string): Promise<void> {
await api.delete(`/v1/api-keys/${id}`);
}