π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix(nc-gui): replace existing view with api res updated view instead of calling load views api
Ramesh Mane80852bd45e38
diff --git a/packages/nc-gui/components/nc/List/index.vue b/packages/nc-gui/components/nc/List/index.vueindex 2c5e145238..aebe5e2ba0 100644--- a/packages/nc-gui/components/nc/List/index.vue+++ b/packages/nc-gui/components/nc/List/index.vue@@ -372,6 +372,7 @@ const handleEscape = (event: KeyboardEvent) => {:class="`nc-theme-${theme}`"allow-clear:bordered="inputBordered"+ autocomplete="off"@keydown.enter.stop="handleKeydownEnter"@change="handleResetHoverEffect(false, 0)">diff --git a/packages/nc-gui/store/views.ts b/packages/nc-gui/store/views.tsindex ccde94a9dd..e910f13efe 100644--- a/packages/nc-gui/store/views.ts+++ b/packages/nc-gui/store/views.ts@@ -881,7 +881,7 @@ export const useViewsStore = defineStore('viewsStore', () => {}try {- await $api.internal.postOperation(+ const res = await $api.internal.postOperation(activeWorkspaceId.value!,destView.base_id!,{@@ -904,12 +904,17 @@ export const useViewsStore = defineStore('viewsStore', () => {await getMeta(destView.fk_model_id!, true)}- if (- settingToOverride.some((type) =>- [ViewSettingOverrideOptions.ROW_HEIGHT, ViewSettingOverrideOptions.ROW_COLORING].includes(type),- )- ) {- await loadViews({ tableId: destView.fk_model_id!, ignoreLoading: true, force: true })+ if (res?.view && destView.fk_model_id) {+ const tableViews = viewsByTable.value.get(destView.fk_model_id) || []+ const viewIndex = tableViews.findIndex((v) => v.id === destView.id)++ if (viewIndex !== -1) {+ // Replace with the response from API+ tableViews[viewIndex] = res.view+ viewsByTable.value.set(destView.fk_model_id, [...tableViews])++ refreshCommandPalette()+ }}// Reload view meta as well as data if the destination view is the active view