refractor api bit more
This commit is contained in:
@@ -228,6 +228,13 @@ object Entities {
|
||||
}
|
||||
|
||||
fun view(it: Context) {
|
||||
database.save(
|
||||
AuditLog().apply {
|
||||
auditType = AuditType.VIEW
|
||||
entity = it.pathParam("entity")
|
||||
uniqueIdentifier = it.pathParam("id")
|
||||
}
|
||||
)
|
||||
it.json(
|
||||
database.findDataModelByEntityAndUniqId(it.pathParam("entity"), it.pathParam("id"))
|
||||
)
|
||||
@@ -332,6 +339,16 @@ object Entities {
|
||||
if (setupEntity != null && !setupEntity.postSaveScript.isNullOrEmpty()) {
|
||||
Scripting.execute(setupEntity.postSaveScript!!, "postSave", dataModel)
|
||||
}
|
||||
|
||||
|
||||
database.save(
|
||||
AuditLog().apply {
|
||||
auditType = AuditType.CREATE
|
||||
this.entity = entity
|
||||
uniqueIdentifier = dataModel.uniqueIdentifier
|
||||
this.data = dataModel.data
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private fun isValidDate(f: String) = try {
|
||||
|
||||
Reference in New Issue
Block a user