Browse Source

fix(nocodb): handle error in gui

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

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

@ -514,6 +514,8 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState(
}) })
if (!base?.value?.id || !meta.value?.id || !viewMeta.value?.id) return if (!base?.value?.id || !meta.value?.id || !viewMeta.value?.id) return
try {
const res = !isPublic.value const res = !isPublic.value
? await api.dbViewRow.calendarCount('noco', base.value.id!, meta.value!.id!, viewMeta.value.id, { ? await api.dbViewRow.calendarCount('noco', base.value.id!, meta.value!.id!, viewMeta.value.id, {
...queryParams.value, ...queryParams.value,
@ -525,10 +527,10 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState(
sortsArr: sorts.value, sortsArr: sorts.value,
filtersArr: activeDateFilter, filtersArr: activeDateFilter,
}) })
if (res) {
activeDates.value = res.map((dateObj: unknown) => dayjs(dateObj)) activeDates.value = res.map((dateObj: unknown) => dayjs(dateObj))
} else { } catch (e) {
activeDates.value = [] 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" "groupClearIsNotSupportedOnLinksColumn": "Group clear operation is not supported on Links/LinkToAnotherRecord column"
}, },
"error": { "error": {
"fetchingActiveDates": "Error fetching active dates",
"scopesRequired": "Scopes required", "scopesRequired": "Scopes required",
"authUrlRequired": "Auth URL is required", "authUrlRequired": "Auth URL is required",
"userNameAttributeRequired": "Username attribute is required", "userNameAttributeRequired": "Username attribute is required",

Loading…
Cancel
Save