add runtime profile deletion and refine config forms
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -206,6 +206,11 @@ export class AppsController {
|
|||||||
return this.appsService.createRuntimeProfile(body);
|
return this.appsService.createRuntimeProfile(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Delete('runtime-profiles/:profileId')
|
||||||
|
deleteRuntimeProfile(@Param('profileId') profileId: string) {
|
||||||
|
return this.appsService.deleteRuntimeProfile(profileId);
|
||||||
|
}
|
||||||
|
|
||||||
@Post('runtime-profiles/:profileId/variables')
|
@Post('runtime-profiles/:profileId/variables')
|
||||||
createRuntimeVariable(
|
createRuntimeVariable(
|
||||||
@Param('profileId') profileId: string,
|
@Param('profileId') profileId: string,
|
||||||
|
|||||||
@@ -1594,6 +1594,23 @@ export class AppsService {
|
|||||||
return { profile };
|
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) {
|
async createRuntimeVariable(profileId: string, body: CreateRuntimeEnvVariableDto) {
|
||||||
const profile = await this.prisma.runtimeEnvProfile.findUnique({
|
const profile = await this.prisma.runtimeEnvProfile.findUnique({
|
||||||
where: { id: profileId },
|
where: { id: profileId },
|
||||||
|
|||||||
Reference in New Issue
Block a user