Conversation
Signed-off-by: Maksymilian Pamuła <maksymilian.pamula@gmail.com>
Signed-off-by: Maksymilian Pamuła <maksymilian.pamula@gmail.com>
…d - when fetch relation Signed-off-by: Maksymilian Pamuła <maksymilian.pamula@gmail.com>
Signed-off-by: Maksymilian Pamuła <maksymilian.pamula@gmail.com>
|
Hey @Kronos66 I tried this PR and I can actually see the versions dropdown now, but no data are saved in the db table On a single types (named |
Signed-off-by: Maksymilian Pamuła <maksymilian.pamula@gmail.com>
Hi @vuolter, I added support for single types. |
| const { id: singleTypeId } = await model.findOne({}); | ||
| knexQueryBuilder | ||
| .where({ content_type: contentType, entity_id: singleTypeId }); |
There was a problem hiding this comment.
We need to check if the query returns actually an entry, I changed this block to:
const entry = await model.findOne({});
if (entry) {
knexQueryBuilder.where({
content_type: contentType,
entity_id: entry.id,
});
}
There was a problem hiding this comment.
good catch I will fix this in next commit :) thank you
| return versionsForCurrentId.map((el) => ({ | ||
| content: el.entity, | ||
| return versionsForCurrentContentType.map((el) => ({ | ||
| content: JSON.parse(el.entity), |
There was a problem hiding this comment.
Looks like el.entity is already an object, I reverted to:
content: el.entity,
There was a problem hiding this comment.
Strange, because we write data to database as json and here we always get string
There was a problem hiding this comment.
I have one question about this problem, what database do you use?
There was a problem hiding this comment.
If i remember correctly this happens also with built-in sqlite @Kronos66
There was a problem hiding this comment.
Hi, @vuolter , sorry for delay
I added the saveParse method to handle objects, now everything should works correctly
There was a problem hiding this comment.
Hi @Kronos66, sorry to reply so late.... I tried your latest changes under sqlite and mysql on a fresh installation and everything looks working fine, on both.
I'll try to check on postgresql as well and let you know.
Signed-off-by: Maksymilian Pamuła <maksymilian.pamula@gmail.com>
Signed-off-by: Maksymilian Pamuła <maksymilian.pamula@gmail.com>
|
I am getting TypeError: Cannot read property 'listEntityVersions' of undefined when I try to spin it up, but if I remove the first route in the routes.json file, I can spin up my environment, however, it is unable to get the versions of the collection types. Has anyone else gotten this or know how to fix it? |
|
What's the status on this @Kronos66 ? I need versioning in an app, if this works it'd be great :) |


No description provided.