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:
parent
82fdfbd18b
commit
cf0e820632
@ -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
|
||||
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user