Skip to content

Commit

Permalink
fix attribute uid with attribute select
Browse files Browse the repository at this point in the history
  • Loading branch information
dvargas92495 committed Apr 14, 2022
1 parent 8020703 commit 739f6f9
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/utils/fireQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,17 @@ const predefinedSelections: PredefinedSelection[] = [
test: /.*/,
pull: ({ returnNode }) => `(pull ?${returnNode} [:block/uid])`,
mapper: (r, key) => {
return (
(
window.roamAlphaAPI.data.fast.q(
`[:find (pull ?b [:block/string]) :where [?a :node/title "${normalizePageTitle(
key
)}"] [?p :block/uid "${
r[":block/uid"]
}"] [?b :block/refs ?a] [?b :block/parents ?p]]`
)?.[0]?.[0] as PullBlock
)?.[":block/string"] || ""
)
.slice(key.length + 2)
.trim();
const block = window.roamAlphaAPI.data.fast.q(
`[:find (pull ?b [:block/string :block/uid]) :where [?a :node/title "${normalizePageTitle(
key
)}"] [?p :block/uid "${
r[":block/uid"]
}"] [?b :block/refs ?a] [?b :block/parents ?p]]`
)?.[0]?.[0] as PullBlock;
return {
"": (block[":block/string"] || "").slice(key.length + 2).trim(),
"-uid": block[":block/uid"],
};
},
},
];
Expand Down

0 comments on commit 739f6f9

Please sign in to comment.