From 321ab28c19403ea8fcae578cd9d6b5c1428d3f03 Mon Sep 17 00:00:00 2001 From: EnzoVezzaro Date: Thu, 8 Sep 2022 09:37:21 -0400 Subject: [PATCH] added interface to FormEditMetadata --- src/components/Asset/Edit/FormEditMetadata.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/Asset/Edit/FormEditMetadata.tsx b/src/components/Asset/Edit/FormEditMetadata.tsx index da69aebf8..cf27ef9d6 100644 --- a/src/components/Asset/Edit/FormEditMetadata.tsx +++ b/src/components/Asset/Edit/FormEditMetadata.tsx @@ -15,6 +15,16 @@ export function checkIfTimeoutInPredefinedValues( return false } +interface FormEditMetadataValues { + author: string + description: string + files: string + links: string + name: string + price: string + timeout: string +} + export default function FormEditMetadata({ data, showPrice, @@ -25,8 +35,8 @@ export default function FormEditMetadata({ data: InputProps[] showPrice: boolean isComputeDataset: boolean - initialValues: any - currentValues: any + initialValues: FormEditMetadataValues + currentValues: FormEditMetadataValues }): ReactElement { const { oceanConfig } = useAsset() @@ -34,7 +44,7 @@ export default function FormEditMetadata({ // we'll add an outline when an input has changed const getDifference = (a: any, b: any) => Object.entries(a).reduce( - (ac, [k, v]) => (b[k] && b[k] !== v ? ((ac[k] = b[k]), ac) : ac), + (ac: any, [k, v]) => (b[k] && b[k] !== v ? ((ac[k] = b[k]), ac) : ac), {} )