绑定的标记不让删除
parent
a86448a5c1
commit
3d671c79ea
|
@ -354,7 +354,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost("{id:guid}")]
|
[HttpPost("{id:guid}")]
|
||||||
public async Task<IResponseOutput> DeleteCustomTag(Guid id)
|
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);
|
var success = await _readingTaskQuestionMarkRepository.DeleteFromQueryAsync(t => t.Id == id||t.MarkId==id, true);
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue