diff --git a/apps/client/src/features/app-settings/panel/sources-panel/SourcesPanel.tsx b/apps/client/src/features/app-settings/panel/sources-panel/SourcesPanel.tsx index 7bb896df4..fb804052b 100644 --- a/apps/client/src/features/app-settings/panel/sources-panel/SourcesPanel.tsx +++ b/apps/client/src/features/app-settings/panel/sources-panel/SourcesPanel.tsx @@ -2,7 +2,7 @@ import { ChangeEvent, useRef, useState } from 'react'; import { Button, Input } from '@chakra-ui/react'; import { IoCloudOutline } from '@react-icons/all-files/io5/IoCloudOutline'; import { IoDownloadOutline } from '@react-icons/all-files/io5/IoDownloadOutline'; -import { ImportMap, unpackError } from 'ontime-utils'; +import { getErrorMessage, ImportMap } from 'ontime-utils'; import { getWorksheetNames as getWorksheetNamesExcel, @@ -59,7 +59,7 @@ export default function SourcesPanel() { setImportFlow('excel'); setHasFile('done'); } catch (error) { - const errorMessage = unpackError(error); + const errorMessage = getErrorMessage(error); setError(`Error uploading file: ${errorMessage}`); setWorksheets(null); setHasFile('none'); diff --git a/apps/server/src/api-data/custom-fields/customFields.controller.ts b/apps/server/src/api-data/custom-fields/customFields.controller.ts index 42c428c08..71c55f5f8 100644 --- a/apps/server/src/api-data/custom-fields/customFields.controller.ts +++ b/apps/server/src/api-data/custom-fields/customFields.controller.ts @@ -1,7 +1,8 @@ -import { CustomField, CustomFields } from 'ontime-types'; +import { CustomField, CustomFields, ErrorResponse } from 'ontime-types'; import type { Request, Response } from 'express'; +import { getErrorMessage } from 'ontime-utils'; import { createCustomField, editCustomField, @@ -14,36 +15,37 @@ export async function getCustomFields(_req: Request, res: Response res.json(customFields); } -// Expects { label: