forked from mito-systems/sol-mem-gen
Remove unused script from package.json
This commit is contained in:
parent
d360e14aa3
commit
8707affa60
@ -4,7 +4,6 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "ts-node --project tsconfig.server.json server.ts",
|
||||
"upload-image": "ts-node --project tsconfig.server.json upload-image-to-pinata.ts",
|
||||
"build": "next build",
|
||||
"start": "tsc --project tsconfig.server.json && NODE_ENV=production PORT=80 node dist/server.js",
|
||||
"lint": "next lint"
|
||||
|
@ -16,14 +16,11 @@ export async function uploadToPinata(imageUrl: string): Promise<FluxGenerationRe
|
||||
try {
|
||||
const upload = await pinata.upload.url(imageUrl);
|
||||
|
||||
if (!upload.IpfsHash) {
|
||||
throw new Error("Upload failed: IPFS hash not returned.");
|
||||
}
|
||||
|
||||
const publicURL = await pinata.gateways.convert(upload.IpfsHash);
|
||||
|
||||
return { imageUrl: publicURL };
|
||||
} catch (error) {
|
||||
console.error('Error uploading to Pinata:', error)
|
||||
return {
|
||||
error: error instanceof Error ? error.message : 'Upload failed'
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user