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`
|
const getReceipts = gql`
|
||||||
query ReceiptData($address: ID!) {
|
query ReceiptData($address: ID!) {
|
||||||
datatokens(where: { id: $address }) {
|
nftUpdates(
|
||||||
updates(orderBy: timestamp, orderDirection: desc) {
|
where: { id: $address }
|
||||||
|
subgraphError: deny
|
||||||
|
orderBy: timestamp
|
||||||
|
orderDirection: desc
|
||||||
|
) {
|
||||||
id
|
id
|
||||||
tx
|
tx
|
||||||
timestamp
|
timestamp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
`
|
`
|
||||||
|
|
||||||
export default function EditHistory(): ReactElement {
|
export default function EditHistory(): ReactElement {
|
||||||
@ -50,13 +53,13 @@ export default function EditHistory(): ReactElement {
|
|||||||
const [creationTx, setCreationTx] = useState<string>()
|
const [creationTx, setCreationTx] = useState<string>()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!data || data.datatokens.length === 0) return
|
if (!data || data.nftUpdates.length === 0) return
|
||||||
|
|
||||||
const receiptCollectionLength = data.datatokens[0].updates.length
|
const receiptCollectionLength = data.nftUpdates.length
|
||||||
const creationData = data.datatokens[0].updates[receiptCollectionLength - 1]
|
const creationData = data.nftUpdates[receiptCollectionLength - 1]
|
||||||
setCreationTx(creationData.tx)
|
setCreationTx(creationData.tx)
|
||||||
|
|
||||||
const receiptCollection = [...data.datatokens[0].updates]
|
const receiptCollection = [...data.nftUpdates]
|
||||||
receiptCollection.splice(-1, 1)
|
receiptCollection.splice(-1, 1)
|
||||||
|
|
||||||
setReceipts(receiptCollection)
|
setReceipts(receiptCollection)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user