-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathUpdateTemplateMetadata.ts
More file actions
25 lines (23 loc) · 1019 Bytes
/
UpdateTemplateMetadata.ts
File metadata and controls
25 lines (23 loc) · 1019 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
import { UseCase } from '../../../core/domain/useCases/UseCase'
import { UpdateTemplateMetadataDTO } from '../dtos/UpdateTemplateMetadataDTO'
import { ITemplatesRepository } from '../repositories/ITemplatesRepository'
export class UpdateTemplateMetadata implements UseCase<void> {
private templatesRepository: ITemplatesRepository
constructor(templatesRepository: ITemplatesRepository) {
this.templatesRepository = templatesRepository
}
/**
* Updates the metadata for a template with the given identifier.
*
* @param {number} templateId - The unique identifier of the template to update.
* @param {UpdateTemplateMetadataDTO} payload - The metadata to apply to the template.
* @returns {Promise<void>} A promise that resolves when the metadata has been updated.
*/
async execute(
templateId: number,
payload: UpdateTemplateMetadataDTO,
replace = false
): Promise<void> {
return await this.templatesRepository.updateTemplateMetadata(templateId, payload, replace)
}
}