From a0abe7e17c6ce08d87c96427fe73375bbdd34a24 Mon Sep 17 00:00:00 2001 From: mihaisc Date: Wed, 16 Mar 2022 22:29:27 +0200 Subject: [PATCH] Fix previous order tx (#1197) * rename nft update query Signed-off-by: mihaisc * fix previous order Signed-off-by: mihaisc --- src/@utils/accessDetailsAndPricing.ts | 6 +++--- src/components/Asset/AssetActions/Compute/index.tsx | 2 +- src/components/Asset/AssetContent/EditHistory.tsx | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/@utils/accessDetailsAndPricing.ts b/src/@utils/accessDetailsAndPricing.ts index afe379366..9504b26fe 100644 --- a/src/@utils/accessDetailsAndPricing.ts +++ b/src/@utils/accessDetailsAndPricing.ts @@ -23,7 +23,7 @@ const TokensPriceQuery = gql` symbol name orders( - where: { consumer: $account } + where: { payer: $account } orderBy: createdTimestamp orderDirection: desc ) { @@ -84,7 +84,7 @@ const TokenPriceQuery = gql` symbol name orders( - where: { consumer: $account } + where: { payer: $account } orderBy: createdTimestamp orderDirection: desc ) { @@ -223,7 +223,7 @@ function getAccessDetailsFromTokenPrice( } /** - * This will be used to get price including feed before ordering + * This will be used to get price including fees before ordering * @param {AssetExtended} asset * @return {Promise} */ diff --git a/src/components/Asset/AssetActions/Compute/index.tsx b/src/components/Asset/AssetActions/Compute/index.tsx index 04037919f..068b2f505 100644 --- a/src/components/Asset/AssetActions/Compute/index.tsx +++ b/src/components/Asset/AssetActions/Compute/index.tsx @@ -181,7 +181,7 @@ export default function Compute({ ) const datasetPriceAndFees = await getOrderPriceAndFees( asset, - ZERO_ADDRESS, + accountId, computeEnv?.id, validUntil ) diff --git a/src/components/Asset/AssetContent/EditHistory.tsx b/src/components/Asset/AssetContent/EditHistory.tsx index f295e7f26..4e75c9ea7 100644 --- a/src/components/Asset/AssetContent/EditHistory.tsx +++ b/src/components/Asset/AssetContent/EditHistory.tsx @@ -3,12 +3,12 @@ import { useAsset } from '@context/Asset' import ExplorerLink from '@shared/ExplorerLink' import Time from '@shared/atoms/Time' import { gql, OperationContext, useQuery } from 'urql' -import { ReceiptData_nftUpdates as ReceiptData } from '../../../@types/subgraph/ReceiptData' +import { NftUpdate_nftUpdates as NftUpdate } from '../../../@types/subgraph/NftUpdate' import { getQueryContext } from '@utils/subgraph' import styles from './EditHistory.module.css' const getReceipts = gql` - query ReceiptData($address: String!) { + query NftUpdate($address: String!) { nftUpdates( where: { nft: $address } orderBy: timestamp @@ -66,7 +66,7 @@ export default function EditHistory(): ReactElement { // // 2. Construct display data based on fetched data. // - const [receipts, setReceipts] = useState() + const [receipts, setReceipts] = useState() useEffect(() => { if (!data || data.nftUpdates.length === 0) return