From 7d911f247678c2a6e32668e139a206de49371391 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 21 Jun 2023 12:23:45 +0530 Subject: [PATCH] fix: instead of title/alias use id with nested apis to avoid unexpected behaviour Signed-off-by: Pranav C --- packages/nc-gui/composables/useLTARStore.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/nc-gui/composables/useLTARStore.ts b/packages/nc-gui/composables/useLTARStore.ts index bdf47af6f9..5eb8bcbdcb 100644 --- a/packages/nc-gui/composables/useLTARStore.ts +++ b/packages/nc-gui/composables/useLTARStore.ts @@ -158,7 +158,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( meta.value.id, rowId.value, colOptions.type as 'mm' | 'hm', - encodeURIComponent(column?.value?.title), + column?.value?.id, { limit: String(childrenExcludedListPagination.size), offset: String(childrenExcludedListPagination.size * (childrenExcludedListPagination.page - 1)), @@ -183,7 +183,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( sharedView.value?.uuid as string, rowId.value, colOptions.type as 'mm' | 'hm', - encodeURIComponent(column?.value?.id), + column?.value?.id, { limit: String(childrenListPagination.size), offset: String(childrenListPagination.size * (childrenListPagination.page - 1)), @@ -198,7 +198,7 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( meta.value.id, rowId.value, colOptions.type as 'mm' | 'hm', - encodeURIComponent(column?.value?.title), + column?.value?.id, { limit: String(childrenListPagination.size), offset: String(childrenListPagination.size * (childrenListPagination.page - 1)), @@ -267,11 +267,11 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( // todo: audit await $api.dbTableRow.nestedRemove( NOCO, - project.value.title as string, - metaValue.title, + project.value.id as string, + metaValue.id!, rowId.value, colOptions.type as 'mm' | 'hm', - encodeURIComponent(column?.value?.title), + column?.value?.id, getRelatedTableRowId(row) as string, ) @@ -313,11 +313,11 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( try { await $api.dbTableRow.nestedAdd( NOCO, - project.value.title as string, - metaValue.title as string, + project.value.id as string, + metaValue.id as string, rowId.value, colOptions.type as 'mm' | 'hm', - encodeURIComponent(column?.value?.title), + column?.value?.id, getRelatedTableRowId(row) as string, ) await loadChildrenList()