1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

added interface to FormEditMetadata

This commit is contained in:
EnzoVezzaro 2022-09-08 09:37:21 -04:00
parent 3ec3d8545b
commit 321ab28c19

View File

@ -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),
{}
)