MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / deleteClient

Function deleteClient

apps/api/src/controllers/manage.controller.ts:373–397  ·  view source on GitHub ↗
(
  request: FastifyRequest<{ Params: { id: string } }>,
  reply: FastifyReply
)

Source from the content-addressed store, hash-verified

371}
372
373export async function deleteClient(
374 request: FastifyRequest<{ Params: { id: string } }>,
375 reply: FastifyReply
376) {
377 const client = await db.client.findFirst({
378 where: {
379 id: request.params.id,
380 organizationId: request.client!.organizationId,
381 },
382 });
383
384 if (!client) {
385 throw new HttpError('Client not found', { status: 404 });
386 }
387
388 await db.client.delete({
389 where: {
390 id: request.params.id,
391 },
392 });
393
394 await getClientByIdCached.clear(request.params.id);
395
396 reply.send({ success: true });
397}
398
399// References CRUD
400export async function listReferences(

Callers

nothing calls this directly

Calls 2

clearMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected