Adding unique key check to insert action; adding post-insert customizer

This commit is contained in:
2022-12-05 15:40:08 -06:00
parent c22fc89cbb
commit a769d8942c
19 changed files with 986 additions and 124 deletions

View File

@ -522,6 +522,11 @@ public class QJavalinImplementation
InsertAction insertAction = new InsertAction();
InsertOutput insertOutput = insertAction.execute(insertInput);
if(CollectionUtils.nullSafeHasContents(insertOutput.getRecords().get(0).getErrors()))
{
throw (new QUserFacingException("Error inserting " + qInstance.getTable(table).getLabel() + ": " + insertOutput.getRecords().get(0).getErrors().get(0)));
}
context.result(JsonUtils.toJson(insertOutput));
}
catch(Exception e)