Browse Source

fix(nocodb): handle error in gui

pull/7687/head
DarkPhoenix2704 10 months ago
parent
commit
cf4df9f0a4
  1. 30
      packages/nc-gui/composables/useCalendarViewStore.ts
  2. 1
      packages/nc-gui/lang/en.json

30
packages/nc-gui/composables/useCalendarViewStore.ts

@ -514,21 +514,23 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState(
})
if (!base?.value?.id || !meta.value?.id || !viewMeta.value?.id) return
const res = !isPublic.value
? await api.dbViewRow.calendarCount('noco', base.value.id!, meta.value!.id!, viewMeta.value.id, {
...queryParams.value,
...{},
...{},
...{ filterArrJson: JSON.stringify([...activeDateFilter]) },
})
: await fetchSharedViewActiveDate({
sortsArr: sorts.value,
filtersArr: activeDateFilter,
})
if (res) {
try {
const res = !isPublic.value
? await api.dbViewRow.calendarCount('noco', base.value.id!, meta.value!.id!, viewMeta.value.id, {
...queryParams.value,
...{},
...{},
...{ filterArrJson: JSON.stringify([...activeDateFilter]) },
})
: await fetchSharedViewActiveDate({
sortsArr: sorts.value,
filtersArr: activeDateFilter,
})
activeDates.value = res.map((dateObj: unknown) => dayjs(dateObj))
} else {
activeDates.value = []
} catch (e) {
message.error(`${t('msg.error.fetchingActiveDates')} ${await extractSdkResponseErrorMsg(e)}`)
console.log(e)
}
}

1
packages/nc-gui/lang/en.json

@ -1286,6 +1286,7 @@
"groupClearIsNotSupportedOnLinksColumn": "Group clear operation is not supported on Links/LinkToAnotherRecord column"
},
"error": {
"fetchingActiveDates": "Error fetching active dates",
"scopesRequired": "Scopes required",
"authUrlRequired": "Auth URL is required",
"userNameAttributeRequired": "Username attribute is required",

Loading…
Cancel
Save