fix: we need to read json, not form data

This commit is contained in:
Derrick Hammer 2023-12-18 02:01:47 -05:00
parent 64c5642010
commit 8277c3e6df
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 2 deletions

View File

@ -14,8 +14,7 @@ import path from "path";
// Action function for POST requests // Action function for POST requests
export async function action({ request }: ActionFunctionArgs) { export async function action({ request }: ActionFunctionArgs) {
const client = new S5Client("https://s5.web3portal.com"); const client = new S5Client("https://s5.web3portal.com");
const formData = await request.formData(); const data = await request.json();
const data = Object.fromEntries(formData.entries());
const meta = (await client.getMetadata(data.cid as string)) as any; const meta = (await client.getMetadata(data.cid as string)) as any;
const fileMeta = meta.metadata as any; const fileMeta = meta.metadata as any;
const paths = fileMeta.paths as { const paths = fileMeta.paths as {