-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Expand file tree
/
Copy pathtemplate.controller.ts
More file actions
26 lines (21 loc) · 911 Bytes
/
template.controller.ts
File metadata and controls
26 lines (21 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { InstanceDto } from '@api/dto/instance.dto';
import { TemplateDto } from '@api/dto/template.dto';
import { TemplateService } from '@api/services/template.service';
export class TemplateController {
constructor(private readonly templateService: TemplateService) {}
public async createTemplate(instance: InstanceDto, data: TemplateDto) {
return this.templateService.create(instance, data);
}
public async findTemplate(instance: InstanceDto) {
return this.templateService.find(instance);
}
public async editTemplate(
instance: InstanceDto,
data: { templateId: string; category?: string; components?: any; allowCategoryChange?: boolean; ttl?: number },
) {
return this.templateService.edit(instance, data);
}
public async deleteTemplate(instance: InstanceDto, data: { name: string; hsmId?: string }) {
return this.templateService.delete(instance, data);
}
}