-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgrade graph version, remove web3storage functionality,
- Loading branch information
Showing
5 changed files
with
25 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import { NextResponse } from "next/server"; | ||
import { Web3Storage, File } from "web3.storage"; | ||
// import { Web3Storage, File } from "web3.storage"; | ||
|
||
export async function POST(req: Request) { | ||
const formData = await req.formData(); | ||
const formDataEntries = Array.from(formData.entries()); | ||
// const formData = await req.formData(); | ||
// const formDataEntries = Array.from(formData.entries()); | ||
|
||
const files = []; | ||
for (const [fieldName, formDataEntryValue] of formDataEntries) { | ||
if ( | ||
typeof formDataEntryValue === "object" && | ||
"arrayBuffer" in formDataEntryValue | ||
) { | ||
const blob = formDataEntryValue as Blob; | ||
// Create a File object from the Blob and set its name. | ||
const file = new File([blob], fieldName); | ||
files.push(file); | ||
} | ||
} | ||
// const files = []; | ||
// for (const [fieldName, formDataEntryValue] of formDataEntries) { | ||
// if ( | ||
// typeof formDataEntryValue === "object" && | ||
// "arrayBuffer" in formDataEntryValue | ||
// ) { | ||
// const blob = formDataEntryValue as Blob; | ||
// // Create a File object from the Blob and set its name. | ||
// const file = new File([blob], fieldName); | ||
// files.push(file); | ||
// } | ||
// } | ||
|
||
const client = new Web3Storage({ | ||
token: String(process.env.WEB3_STORAGE_TOKEN), | ||
}); | ||
// const client = new Web3Storage({ | ||
// token: String(process.env.WEB3_STORAGE_TOKEN), | ||
// }); | ||
|
||
const cid = await client.put(files); | ||
// const cid = await client.put(files); | ||
|
||
return NextResponse.json({ cid }); | ||
return NextResponse.json({ cid: "0x00" }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export const contractConstants = { | ||
PeerGradingAddress: "0x1C7E64bF2A366DCE4EFDEb671e9cc988ec625d7a", | ||
PeerGradingAddress: "0x90164B2beaD98d87a7D9435761FDeBBF00c14513", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { ApolloClient, InMemoryCache } from "@apollo/client"; | ||
|
||
export const client = new ApolloClient({ | ||
uri: "https://api.studio.thegraph.com/query/53131/peer-grading-subgraph/v0.0.11", | ||
uri: "https://api.studio.thegraph.com/query/53131/peer-grading-subgraph/v0.0.12", | ||
cache: new InMemoryCache(), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters