fix(xo-server/rest-api): fix empty object's tasks list

Introduced by 1da05e239

Since task data were moved into properties, the relation between an object and
its tasks was incorrectly checked which led to an abnormal empty tasks list.
This commit is contained in:
Julien Fontanet 2024-02-05 13:24:29 +01:00
parent 82fdfbd18b
commit cf0e820632
2 changed files with 5 additions and 1 deletions

View File

@ -13,6 +13,7 @@
- [Import/VM] Fix `UUID_INVALID(VM, OpaqueRef:...)` error when importing from URL
- [Proxies] Fix `xapi.getOrWaitObject is not a function` is not a function during deployment
- [REST API] Fix empty object's tasks list
### Packages to release

View File

@ -620,7 +620,10 @@ export default class RestApi {
const { query } = req
const objectId = req.xoObject.id
const tasks = app.tasks.list({
filter: every(_ => _.status === 'pending' && _.objectId === objectId, handleOptionalUserFilter(query.filter)),
filter: every(
_ => _.status === 'pending' && _.properties.objectId === objectId,
handleOptionalUserFilter(query.filter)
),
limit: ifDef(query.limit, Number),
})
await sendObjects(tasks, req, res, req.baseUrl + '/tasks')