Skip to content

Commit

Permalink
Add blob url as constant
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhelp committed Aug 17, 2024
1 parent e3d1e45 commit e3b3fb6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/web/src/components/registration/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import { FileRejection, useDropzone } from "react-dropzone";
import { put, type PutBlobResult } from "@vercel/blob";
import { Tag, TagInput } from "@/components/shadcn/ui/tag/tag-input";
import CreatingRegistration from "./CreatingRegistration";
import { BLOB_RESUME_URL } from "@/lib/constants/shared";

interface RegisterFormProps {
defaultEmail: string;
Expand Down Expand Up @@ -134,7 +135,7 @@ export default function RegisterForm({ defaultEmail }: RegisterFormProps) {
let resume: string = c.noResumeProvidedURL;

if (uploadedFile) {
const fileLocation = `${c.hackathonName}/${c.itteration}/resume/${uploadedFile.name}`;
const fileLocation = `${BLOB_RESUME_URL}/${uploadedFile.name}`;
const newBlob = await put(fileLocation, uploadedFile, {
access: "public",
handleBlobUploadUrl: "/api/upload/resume/register",
Expand Down
8 changes: 8 additions & 0 deletions apps/web/src/lib/constants/shared.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
import c from "config"

const {
hackathonName,
itteration
} = c;

export const ONE_HOUR_IN_MILLISECONDS = 3600000;
export const VERCEL_IP_TIMEZONE_HEADER_KEY = "x-vercel-ip-timezone";
export const BLOB_RESUME_URL = `${c.hackathonName}/${c.itteration}/resume`;

0 comments on commit e3b3fb6

Please sign in to comment.