From dd094712678262a86a9f7fdb217268072844775b Mon Sep 17 00:00:00 2001 From: chyoo Date: Thu, 9 Jul 2026 14:53:45 +0900 Subject: [PATCH] add runtime profile deletion and refine config forms --- src/apps/apps.controller.ts | 5 +++++ src/apps/apps.service.ts | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/apps/apps.controller.ts b/src/apps/apps.controller.ts index 96deef0..21a9905 100644 --- a/src/apps/apps.controller.ts +++ b/src/apps/apps.controller.ts @@ -206,6 +206,11 @@ export class AppsController { return this.appsService.createRuntimeProfile(body); } + @Delete('runtime-profiles/:profileId') + deleteRuntimeProfile(@Param('profileId') profileId: string) { + return this.appsService.deleteRuntimeProfile(profileId); + } + @Post('runtime-profiles/:profileId/variables') createRuntimeVariable( @Param('profileId') profileId: string, diff --git a/src/apps/apps.service.ts b/src/apps/apps.service.ts index 0a422dc..9453ead 100644 --- a/src/apps/apps.service.ts +++ b/src/apps/apps.service.ts @@ -1594,6 +1594,23 @@ export class AppsService { return { profile }; } + async deleteRuntimeProfile(profileId: string) { + const profile = await this.prisma.runtimeEnvProfile.findUnique({ + where: { id: profileId }, + select: { id: true, name: true }, + }); + + if (!profile) { + throw new NotFoundException('실행 설정 프로필을 찾을 수 없습니다.'); + } + + await this.prisma.runtimeEnvProfile.delete({ + where: { id: profileId }, + }); + + return { deleted: true, profileId, name: profile.name }; + } + async createRuntimeVariable(profileId: string, body: CreateRuntimeEnvVariableDto) { const profile = await this.prisma.runtimeEnvProfile.findUnique({ where: { id: profileId },