Migrate Feed updating and build xml to new model

This commit is contained in:
advplyr 2024-12-15 16:56:59 -06:00
parent 369c05936b
commit f8fbd3ac8c
10 changed files with 373 additions and 426 deletions

View file

@ -116,6 +116,7 @@ class CollectionController {
}
// If books array is passed in then update order in collection
let collectionBooksUpdated = false
if (req.body.books?.length) {
const collectionBooks = await req.collection.getCollectionBooks({
include: {
@ -134,9 +135,15 @@ class CollectionController {
await collectionBooks[i].update({
order: i + 1
})
wasUpdated = true
collectionBooksUpdated = true
}
}
if (collectionBooksUpdated) {
req.collection.changed('updatedAt', true)
await req.collection.save()
wasUpdated = true
}
}
const jsonExpanded = await req.collection.getOldJsonExpanded()