This commit is contained in:
2020-06-24 23:51:40 +00:00
parent cc16ed35f6
commit edf13842de

View File

@@ -319,20 +319,20 @@ namespace AyaNova.Biz
//Ensure it's not a stock translation
if (inObj.Stock == true)
{
AddError(ApiErrorCode.INVALID_OPERATION, "object", "Translation is a Stock translation and cannot be deleted");
AddError(ApiErrorCode.INVALID_OPERATION, null, "Translation is a Stock translation and cannot be deleted");
return;
}
if (inObj.Id == ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID)
{
AddError(ApiErrorCode.INVALID_OPERATION, "object", "Translation is set as the default server translation (AYANOVA_DEFAULT_LANGUAGE_ID) and can not be deleted");
AddError(ApiErrorCode.INVALID_OPERATION, null, "Translation is set as the default server translation (AYANOVA_DEFAULT_LANGUAGE_ID) and can not be deleted");
return;
}
//See if any users exist with this translation selected in which case it's not deleteable
if (await ct.UserOptions.AnyAsync(e => e.TranslationId == inObj.Id))
{
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "object", "Can't be deleted in use by one or more Users");
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, null, "Can't be deleted in use by one or more Users");
return;
}
}