Skip to content

Commit

Permalink
deploy s3 7
Browse files Browse the repository at this point in the history
  • Loading branch information
aliamerj committed Mar 10, 2024
1 parent bb52dec commit b5843f4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions app/api/project/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,21 @@ export async function POST(request: NextRequest) {
link,
techUsed,
} = validation.data;

let imageUrl;
try {
// let imageUrl = "x";
// if (logo && logo instanceof File) {
// imageUrl = await setImageInBucket(
// session.user.id!,
// `${session.user.id!}-${name}`,
// logo,
// );
// }

if (logo && logo instanceof File) {
imageUrl = await setImageInBucket(
session.user.id!,
`${session.user.id!}-${name}`,
logo,
);
}

const newProject: ProjectInsertion = {
owner: session.user.id!,
name: name,
logo: "x", // imageUrl && imageUrl.split("?")[0],
logo: imageUrl && imageUrl.split("?")[0],
type: type as ProjectSelection["type"],
link: link,
projectGoal: projectGoal,
Expand All @@ -97,7 +97,7 @@ export async function POST(request: NextRequest) {
} catch (err) {
const errorDetails = JSON.stringify(err, Object.getOwnPropertyNames(err));
return NextResponse.json(
{ state: false, message: "Failed to Upload Image",err: errorDetails},
{ state: false, message: "Failed to Upload Image",err: errorDetails, imageUrl},
{ status: 500 },
);
}
Expand Down

0 comments on commit b5843f4

Please sign in to comment.