Skip to content

Commit 861b1c3

Browse files
committed
chore: update-fetch-query-and-code
1 parent 654d79e commit 861b1c3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

developer/light-curate.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,7 @@ With this in hand we can submit the item.
193193
const gtcr = new ethers.Contract(tcrAddress, _gtcr, signer)
194194
const enc = new TextEncoder()
195195
const fileData = enc.encode(JSON.stringify({ columns, values }))
196-
const ipfsEvidenceObject = await ipfsPublish('item.json', fileData)
197-
const ipfsEvidencePath = `/ipfs/${ipfsEvidenceObject[1].hash +
198-
ipfsEvidenceObject[0].path}`
196+
const ipfsEvidencePath = await ipfsPublish('item.json', fileData)
199197
200198
// Request signature and submit.
201199
const tx = await gtcr.addItem(ipfsEvidencePath, {
@@ -236,8 +234,10 @@ const query = {
236234
itemID
237235
status
238236
data
239-
props {
240-
value
237+
metadata{
238+
props {
239+
value
240+
}
241241
}
242242
requests(first: 1, orderBy: submissionTime, orderDirection: desc) {
243243
disputed
@@ -264,6 +264,9 @@ const query = {
264264
const { data, errors } = await (
265265
await fetch(GTCR_SUBGRAPH_URL, {
266266
method: 'POST',
267+
headers: {
268+
'Content-Type': "application/json",
269+
},
267270
body: JSON.stringify(query)
268271
})
269272
).json()

0 commit comments

Comments
 (0)