max order default to 0 if no relations

This commit is contained in:
Marc-Roig 2022-10-24 11:56:22 +02:00
parent 640adedd73
commit 36ca8d7df6

View File

@ -859,7 +859,7 @@ const createEntityManager = (db) => {
if (!adjacentRelations.find((r) => r[orderColumnName] === maxOrder.max)) {
adjacentRelations.push({
[inverseJoinColumn.name]: -1,
[joinTable.orderColumnName]: maxOrder.max,
[joinTable.orderColumnName]: maxOrder.max || 0,
});
}