You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is there currently a limitation that the ID field of entity must be called "ID". I have an entity where the key field is called "id" (lowercase). This does not seem to work. The problem already seems to be here:
async function track_changes (req) {
let diff = await req.diff()
if (!diff) return
let target = req.target
let compContext = null;
let entityKey = diff.ID <----
The diff object is correctly calculated and there is a key in the property diff.id. But entityKey stays undefined due to id not being in upper case. Fixing this problem allows correct association of change with the entity.
But there are more places later where it fails.
Here, the ID is again hard coded.
function _trackedChanges4 (srv, target, diff) {
const template = getTemplate("change-logging", srv, target, { pick: e => e['@changelog'] })
if (!template.elements.size) return
const changes = []
diff._path = `${target.name}(${diff.ID})`
And later here as queryKey is not provided and the default value is used. const getCurObjFromDbQuery = async function (entityName, queryVal, /**optional*/ queryKey='ID') {
I don't see this limitation being document anywhere. Is there a plan to extend this to have more flexible support of entities? If not, can this be at least documented and that only entities with key ID are supported?
The text was updated successfully, but these errors were encountered:
Hi,
is there currently a limitation that the ID field of entity must be called "ID". I have an entity where the key field is called "id" (lowercase). This does not seem to work. The problem already seems to be here:
The diff object is correctly calculated and there is a key in the property diff.id. But entityKey stays undefined due to id not being in upper case. Fixing this problem allows correct association of change with the entity.
But there are more places later where it fails.
Here, the ID is again hard coded.
And later here as queryKey is not provided and the default value is used.
const getCurObjFromDbQuery = async function (entityName, queryVal, /**optional*/ queryKey='ID') {
I don't see this limitation being document anywhere. Is there a plan to extend this to have more flexible support of entities? If not, can this be at least documented and that only entities with key ID are supported?
The text was updated successfully, but these errors were encountered: