diff --git a/packages/nc-gui/composables/useCalendarViewStore.ts b/packages/nc-gui/composables/useCalendarViewStore.ts index f6efdc26b2..fedf1dfc82 100644 --- a/packages/nc-gui/composables/useCalendarViewStore.ts +++ b/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) } } diff --git a/packages/nc-gui/lang/en.json b/packages/nc-gui/lang/en.json index 61b23ad71a..096eafbece 100644 --- a/packages/nc-gui/lang/en.json +++ b/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",