Skip to content

fix(next): pass a corrent content-type header in getFile route#5799

Merged
JarrodMFlesch merged 27 commits into
payloadcms:betafrom
r1tsuu:fix/pass-content-type-header-get-url
Apr 17, 2024
Merged

fix(next): pass a corrent content-type header in getFile route#5799
JarrodMFlesch merged 27 commits into
payloadcms:betafrom
r1tsuu:fix/pass-content-type-header-get-url

Conversation

@r1tsuu
Copy link
Copy Markdown
Member

@r1tsuu r1tsuu commented Apr 11, 2024

Description

Installed mime-types to @payloadcms/next
Fixes beta-#88

  • I have read and understand the CONTRIBUTING.md document in this repository.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • Existing test suite passes locally with my changes

@r1tsuu r1tsuu changed the title fix: Pass content-type header in getFile route fix(next): pass a corrent content-type header in getFile route Apr 14, 2024
Comment thread packages/next/src/routes/rest/files/getFile.ts Outdated
@r1tsuu
Copy link
Copy Markdown
Member Author

r1tsuu commented Apr 16, 2024

sorry i pulled from wrong remote

@r1tsuu
Copy link
Copy Markdown
Member Author

r1tsuu commented Apr 16, 2024

I honestly don't know why payload/package.json and payload/src/utllities/isEntityHidden.ts were changed but i resolved it.

@r1tsuu
Copy link
Copy Markdown
Member Author

r1tsuu commented Apr 16, 2024

Even though it seems like has something to my PR i don't think it could break opening doc drawer..
i will check locally
upd: actually yes, getFileType.fromFile can return undefined for some reason.
image

@r1tsuu
Copy link
Copy Markdown
Member Author

r1tsuu commented Apr 16, 2024

because of importing from payload/node console shows this.
image
next js doesn't like to import prettier it seems.
and about failing test with the drawer, it opens in the pnpm dev uploads (i did the same like in test, opened the first doc from audio collection, removed file and tried to upload a new), but in e2e it doesn't, i don't have idea
upd: locally this test has passed
image

@r1tsuu r1tsuu requested a review from JarrodMFlesch April 16, 2024 17:33
@r1tsuu
Copy link
Copy Markdown
Member Author

r1tsuu commented Apr 16, 2024

#5846 https://github.com/payloadcms/payload/actions/runs/8680804563/job/23802183251?pr=5846
I also got the same failed test within uploads in my other PR not related to this

@JarrodMFlesch
Copy link
Copy Markdown
Contributor

@r1tsuu I moved file-type to be a peer dep of @payloadcms/next to resolve the webpack error. The upload error is not specific to this PR so no worries there.

@JarrodMFlesch JarrodMFlesch merged commit 8bf03ae into payloadcms:beta Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants