1
0
Fork 0
mirror of synced 2024-06-30 12:00:31 +12:00

Adding a check to the link utils which should make sure the correct link doc is always picked.

This commit is contained in:
mike12345567 2021-02-03 17:19:41 +00:00
parent 39ea169752
commit f182a65547

View file

@ -84,6 +84,13 @@ exports.getLinkDocuments = async function({
// filter to get unique entries
const foundIds = []
linkRows = linkRows.filter(link => {
// make sure anything unique is the correct key
if (
(tableId && link.key[0] !== tableId) ||
(rowId && link.key[1] !== rowId)
) {
return false
}
const unique = foundIds.indexOf(link.id) === -1
if (unique) {
foundIds.push(link.id)