绑定的标记不让删除

Uat_IRC_Net8
he 2025-07-21 15:33:58 +08:00
parent a86448a5c1
commit 3d671c79ea
1 changed files with 7 additions and 0 deletions

View File

@ -354,7 +354,14 @@ namespace IRaCIS.Core.Application.Service
[HttpPost("{id:guid}")]
public async Task<IResponseOutput> DeleteCustomTag(Guid id)
{
if (await _readingTaskQuestionMarkRepository.AnyAsync(t => (t.Id == id || t.MarkId == id) && t.QuestionId != null))
{
throw new BusinessValidationFailedException(_localizer["ReadingCustomTag_CannotDelete"]);
}
var success = await _readingTaskQuestionMarkRepository.DeleteFromQueryAsync(t => t.Id == id||t.MarkId==id, true);
return ResponseOutput.Ok();
}