feat(templates): add service language template management
Add normalized service and template catalogs, scoped administration, migration, validation, and regression coverage. Ref: IT-1601
This commit is contained in:
+9
-1
@@ -1,3 +1,4 @@
|
||||
using HrynCo.NotificationService.DAL.Abstract.Templates;
|
||||
using HrynCo.DAL.Abstract;
|
||||
using HrynCo.NotificationService.DAL.Abstract.Repositories;
|
||||
using HrynCo.NotificationService.Services.Core;
|
||||
@@ -34,7 +35,14 @@ internal sealed class UpdateEmailTemplateHandler
|
||||
template.Variables = request.Variables;
|
||||
template.Updated = DateTimeOffset.UtcNow;
|
||||
|
||||
await _templates.UpdateAsync(template, cancellationToken);
|
||||
try
|
||||
{
|
||||
await _templates.UpdateAsync(template, cancellationToken);
|
||||
}
|
||||
catch (EmailTemplateWriteException error)
|
||||
{
|
||||
return Failure<Unit>(error.Message, error.IsConflict ? ServiceErrorCode.Conflict : ServiceErrorCode.InvalidRequest);
|
||||
}
|
||||
|
||||
return Success(Unit.Value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user