check for rootId

This commit is contained in:
keyan 2023-01-26 13:37:51 -06:00
parent 5306b11157
commit d8e3e73def
1 changed files with 1 additions and 1 deletions

View File

@ -966,7 +966,7 @@ export default {
return me?.id === item.userId
},
root: async (item, args, { models }) => {
if (!item.parentId) {
if (!item.rootId) {
return null
}
return await models.item.findUnique({ where: { id: item.rootId } })