This commit is contained in:
he
2023-06-01 14:55:40 +08:00
parent 865412a551
commit fd478715f3
4 changed files with 11 additions and 1 deletions
@@ -60,7 +60,15 @@ namespace IRaCIS.Core.Application.Service
}
}
var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true);
if(await _userWLTemplateRepository.AnyAsync(x=> x.UserId == _userInfo.Id&&x.TemplateName== addOrEditUserWLTemplate.TemplateName&&x.Id!= addOrEditUserWLTemplate.Id))
{
throw new BusinessValidationFailedException(_localizer["UserWLTS_NameRepeated"]);
}
var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true);
return ResponseOutput.Ok(entity.Id.ToString());
}