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

Function deleteProject

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

Source from the content-addressed store, hash-verified

210}
211
212export async function deleteProject(
213 request: FastifyRequest<{ Params: { id: string } }>,
214 reply: FastifyReply
215) {
216 const project = await db.project.findFirst({
217 where: {
218 id: request.params.id,
219 organizationId: request.client!.organizationId,
220 },
221 });
222
223 if (!project) {
224 throw new HttpError('Project not found', { status: 404 });
225 }
226
227 await db.project.update({
228 where: {
229 id: request.params.id,
230 },
231 data: {
232 deleteAt: new Date(Date.now() + 24 * 60 * 60 * 1000),
233 },
234 });
235
236 await getProjectByIdCached.clear(request.params.id);
237
238 reply.send({ success: true });
239}
240
241// Clients CRUD
242export async function listClients(

Callers

nothing calls this directly

Calls 2

clearMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected