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 },