From ba0cd2450b87df0775e9ce3e6fef1f9d0621ac08 Mon Sep 17 00:00:00 2001 From: vinicvaz Date: Mon, 27 Nov 2023 08:47:42 -0300 Subject: [PATCH] fix typing --- .../workspaceSettings/RepositoriesCard.tsx | 15 +++++++++++++-- .../workspaceSettings/WorkspaceSecretsCard.tsx | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/frontend/src/features/workspaces/components/workspaceSettings/RepositoriesCard.tsx b/frontend/src/features/workspaces/components/workspaceSettings/RepositoriesCard.tsx index 5b5f1081..8e9bf799 100644 --- a/frontend/src/features/workspaces/components/workspaceSettings/RepositoriesCard.tsx +++ b/frontend/src/features/workspaces/components/workspaceSettings/RepositoriesCard.tsx @@ -120,7 +120,9 @@ export const RepositoriesCard: FC = () => { source: source as repositorySource, }) .then((data) => { - setAvailableVersions(data.splice(0, 10)); + if (data) { + setAvailableVersions(data?.splice(0, 10)); + } setStep("SELECT_VERSION"); }) .catch((e) => { @@ -194,7 +196,16 @@ export const RepositoriesCard: FC = () => { - Add Pieces repository by URL. To discover available Pieces repositories, visit the Pieces gallery. + Add Pieces repository by URL. To discover available Pieces + repositories, visit the{" "} + + Pieces gallery + + . { }) .then((response) => { toast.success("Secret updated."); - handleUpdateWorkspace(response.data); + handleUpdateWorkspace(response?.data); resetField(`github-token-workspace-${workspace?.id}`, { keepTouched: false, }); @@ -93,7 +93,7 @@ const WorkspaceSecretsCard = () => { }) .then((response) => { toast.success("Secret updated."); - handleUpdateWorkspace(response.data); + handleUpdateWorkspace(response?.data); }) .catch((_err) => { toast.error("Error while updating secrets");