UNPKG

skailan-contacts

Version:

Servicio de gestión de contactos para Skailan

18 lines 562 B
export class UpdateTag { tagRepository; constructor(tagRepository) { this.tagRepository = tagRepository; } async execute(request) { const { id, organizationId, name } = request; const existingTag = await this.tagRepository.findById(id, organizationId); if (!existingTag) { throw new Error('Tag not found.'); } if (name !== undefined) { existingTag.updateName(name); } return this.tagRepository.save(existingTag); } } //# sourceMappingURL=UpdateTag.js.map