Skip to content

[BUG] Document upload validation schema issues with vercel blob #1839

@kprocks86

Description

@kprocks86

when setting up the full project in local and when i went to upload the pdf document i get Errors in API POST /api/teams/{teamId}/documents

Document upload validation failed for teamId: xxx.

Errors: [
     {
       "code": "custom",
       "message": "File path must be either a Notion URL or an file storage path",
       "path": ["url"]
     },
     {
       "code": "custom", 
       "message": "Storage type does not match the URL/path format, or missing storage type for non-Notion files",
       "path": ["storageType"]
     }
   ]

this below is the request body that is matching against documentUploadSchema

  const testReqBody = {
     name: 'Test Document.pdf',
     url: 'https://example123.public.blob.vercel-storage.com/test-doc.pdf',
     storageType: 'VERCEL_BLOB',
     numPages: 5,
     type: 'pdf',
     contentType: 'application/pdf',
     createLink: false,
     fileSize: 102400
   };

I am testing this in my local development environment
I found out that VERCEL_BLOB_HOST env variable is not present in .env.example env is not uptodate
This issue might come only to the people who are setting up the local system first time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions