mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
migrate metadata history query
This commit is contained in:
parent
c5583c691c
commit
0dca59ac64
@ -9,14 +9,17 @@ import styles from './EditHistory.module.css'
|
||||
|
||||
const getReceipts = gql`
|
||||
query ReceiptData($address: ID!) {
|
||||
datatokens(where: { id: $address }) {
|
||||
updates(orderBy: timestamp, orderDirection: desc) {
|
||||
nftUpdates(
|
||||
where: { id: $address }
|
||||
subgraphError: deny
|
||||
orderBy: timestamp
|
||||
orderDirection: desc
|
||||
) {
|
||||
id
|
||||
tx
|
||||
timestamp
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export default function EditHistory(): ReactElement {
|
||||
@ -50,13 +53,13 @@ export default function EditHistory(): ReactElement {
|
||||
const [creationTx, setCreationTx] = useState<string>()
|
||||
|
||||
useEffect(() => {
|
||||
if (!data || data.datatokens.length === 0) return
|
||||
if (!data || data.nftUpdates.length === 0) return
|
||||
|
||||
const receiptCollectionLength = data.datatokens[0].updates.length
|
||||
const creationData = data.datatokens[0].updates[receiptCollectionLength - 1]
|
||||
const receiptCollectionLength = data.nftUpdates.length
|
||||
const creationData = data.nftUpdates[receiptCollectionLength - 1]
|
||||
setCreationTx(creationData.tx)
|
||||
|
||||
const receiptCollection = [...data.datatokens[0].updates]
|
||||
const receiptCollection = [...data.nftUpdates]
|
||||
receiptCollection.splice(-1, 1)
|
||||
|
||||
setReceipts(receiptCollection)
|
||||
|
Loading…
Reference in New Issue
Block a user