diff --git a/gql_codegen.ts b/gql_codegen.ts index d3581c12..397e6a1a 100644 --- a/gql_codegen.ts +++ b/gql_codegen.ts @@ -10,7 +10,7 @@ import type { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { overwrite: true, - schema: 'http://localhost:4567/api/graphql', + schema: 'http://localhost:45670/api/graphql', documents: [ 'src/lib/graphql/queries/**', 'src/lib/graphql/mutations/**', diff --git a/public/locales/en.json b/public/locales/en.json index db5a3f22..b59b3c8d 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -9,6 +9,7 @@ }, "error": { "label": { + "create_failure": "Could not create category", "empty": "The category is empty", "request_failure": "Could not load categories" }, @@ -511,6 +512,14 @@ }, "value": "{{value}}{{unit}}" }, + "history": { + "error": { + "label": { + "no_history_available": "You have not read any series yet." + } + }, + "title": "History" + }, "hotkeys": { "create": { "dialog": { @@ -1522,13 +1531,5 @@ } }, "title": "Updates" - }, - "history": { - "error": { - "label": { - "no_history_available": "You have not read any series yet." - } - }, - "title": "History" } } diff --git a/src/modules/category/screens/CategorySettings.tsx b/src/modules/category/screens/CategorySettings.tsx index 813d4b49..0348aaec 100644 --- a/src/modules/category/screens/CategorySettings.tsx +++ b/src/modules/category/screens/CategorySettings.tsx @@ -33,6 +33,7 @@ import { CategorySettingsCard } from '@/modules/category/components/CategorySett import { CategoryIdInfo } from '@/modules/category/Category.types.ts'; import { getErrorMessage } from '@/lib/HelperFunctions.ts'; import { useNavBarContext } from '@/modules/navigation-bar/contexts/NavbarContext.tsx'; +import { makeToast } from '@/modules/core/utils/Toast.ts'; export function CategorySettings() { const { t } = useTranslation(); @@ -110,10 +111,18 @@ export function CategorySettings() { setDialogOpen(false); if (categoryToEdit === -1) { - requestManager.createCategory({ name: dialogName, default: dialogDefault }); + requestManager + .createCategory({ name: dialogName, default: dialogDefault }) + .response.catch((e) => + makeToast(t('category.error.label.create_failure'), 'error', getErrorMessage(e)), + ); } else { const category = categories[categoryToEdit]; - requestManager.updateCategory(category.id, { name: dialogName, default: dialogDefault }); + requestManager + .updateCategory(category.id, { name: dialogName, default: dialogDefault }) + .response.catch((e) => + makeToast(t('global.error.label.failed_to_save_changes'), 'error', getErrorMessage(e)), + ); } };