From 9429af22e2720f699bab60eb6de231a4442b3e5a Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Tue, 15 Nov 2022 10:05:12 +0300 Subject: [PATCH] Populating the edit form with the current payment collector --- src/components/Asset/Edit/EditMetadata.tsx | 1 + src/components/Asset/Edit/FormEditMetadata.tsx | 2 +- src/components/Asset/Edit/_constants.ts | 15 +++++++++++---- src/components/Asset/Edit/_types.ts | 1 + 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/components/Asset/Edit/EditMetadata.tsx b/src/components/Asset/Edit/EditMetadata.tsx index fa42718de..26639b0c3 100644 --- a/src/components/Asset/Edit/EditMetadata.tsx +++ b/src/components/Asset/Edit/EditMetadata.tsx @@ -145,6 +145,7 @@ export default function Edit({ { +): Promise> { + const paymentCollector = await getPaymentCollector(owner) return { name: metadata?.name, description: metadata?.description, @@ -15,7 +21,8 @@ export function getInitialValues( files: [{ url: '', type: '' }], timeout: secondsToString(timeout), author: metadata?.author, - tags: metadata?.tags + tags: metadata?.tags, + paymentCollector } } diff --git a/src/components/Asset/Edit/_types.ts b/src/components/Asset/Edit/_types.ts index f5a972cb6..923aabb5c 100644 --- a/src/components/Asset/Edit/_types.ts +++ b/src/components/Asset/Edit/_types.ts @@ -3,6 +3,7 @@ export interface MetadataEditForm { name: string description: string timeout: string + paymentCollector: string price?: string files: FileInfo[] links?: FileInfo[]