Example #1
0
        public async Task UpdateLabelGroupAsync(UpdateLabelGroupRequest request)
        {
            await transactionService.CommitAsync(new[] { TransactionContextScope.Main }, async() =>
            {
                var oldElementType = await labelGroupsRepository.GetElementTypeAsync(request.Id);
                if (oldElementType != LabelElementType.Checkbox && request.Type == LabelElementType.Checkbox)
                {
                    await DeleteLabelsByGroupIdAsync(request.Id);
                    await labelsRepository.AddRangeAsync(GetChechboxLabels(request.Id));
                }

                await labelGroupsRepository.UpdateAsync(mapper.Map <LabelGroup>(request));
            });
        }
 public async Task UpdateLabelGroup([FromBody] UpdateLabelGroupRequest request)
 => await labelService.UpdateLabelGroupAsync(request);