This commit is contained in:
@@ -319,20 +319,20 @@ namespace AyaNova.Biz
|
|||||||
//Ensure it's not a stock translation
|
//Ensure it's not a stock translation
|
||||||
if (inObj.Stock == true)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inObj.Id == ServerBootConfig.AYANOVA_DEFAULT_TRANSLATION_ID)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//See if any users exist with this translation selected in which case it's not deleteable
|
//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))
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user