From ea463f1b5ae5756fabc3d001ad05f423550c4d6b Mon Sep 17 00:00:00 2001 From: Konstantin Dyachenko Date: Sun, 13 Nov 2022 03:08:00 +0000 Subject: [PATCH] Better draft. --- imports/router/links.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/imports/router/links.ts b/imports/router/links.ts index 4ffbcb58..1fac74ce 100644 --- a/imports/router/links.ts +++ b/imports/router/links.ts @@ -385,17 +385,22 @@ export async function handleSelectorOperation(operation: keyof typeof handlerOpe const promiseSelectors = promiseSelectorsResult?.data?.promise_selectors; handleSelectorDebug('promiseSelectors.length', promiseSelectors?.length); - const promiseSelectorsQueryStringDraft = `query SELECT_PROMISE_SELECTORS($itemId: bigint) - { - promise_links(where: { + const promiseSelectorsQueryStringDraft = `query SELECT_PROMISE_SELECTORS($itemId: bigint) { + promise_links(where: { + # old_link_id: { _eq: ${oldLink?.id } }, + # new_link_id: { _eq: ${newLink?.id } }, + values_operation: { _eq: "${operation.replace('Handle', '').toUpperCase()}"}, promise_selectors: { item_id: { _eq: $itemId }, handle_operation: { type_id: { _eq: ${handleOperationTypeId} } } } - }) - { - promise_selectors - { + }) { + id + promise_id + promise_selectors (where: { + item_id: { _eq: $itemId }, + handle_operation: { type_id: { _eq: ${handleOperationTypeId} } } + }) { id promise_id handle_operation {