fix #1261
This commit is contained in:
parent
c6554d3ca7
commit
ce45574bce
|
@ -1155,7 +1155,21 @@ export default {
|
||||||
if (item.root) {
|
if (item.root) {
|
||||||
return item.root
|
return item.root
|
||||||
}
|
}
|
||||||
return await getItem(item, { id: item.rootId }, { me, models })
|
|
||||||
|
// we can't use getItem because activeOrMine will prevent root from being fetched
|
||||||
|
const [root] = await itemQueryWithMeta({
|
||||||
|
me,
|
||||||
|
models,
|
||||||
|
query: `
|
||||||
|
${SELECT}
|
||||||
|
FROM "Item"
|
||||||
|
${whereClause(
|
||||||
|
'"Item".id = $1',
|
||||||
|
`("Item"."invoiceActionState" IS NULL OR "Item"."invoiceActionState" = 'PAID' OR "Item"."userId" = ${me.id})`
|
||||||
|
)}`
|
||||||
|
}, Number(item.rootId))
|
||||||
|
|
||||||
|
return root
|
||||||
},
|
},
|
||||||
invoice: async (item, args, { models }) => {
|
invoice: async (item, args, { models }) => {
|
||||||
if (item.invoiceId) {
|
if (item.invoiceId) {
|
||||||
|
|
Loading…
Reference in New Issue