payload
payload copied to clipboard
fix: do not modify original collections array/obj when sanitizing config
Description
Fixes:
- When instantiating payload more than once, fixes the
DuplicateCollectionerror caused by adding the preferences and migrations collections to the original config collections object.
Explanation:
-
Why instantiate payload more than once? Because I'm using a reduced payload configuration for the local API (dev server performance, customized
@payloadcms/db-postgrespackage). Why is this still occurring when using multiple configurations? Because my collections object is shared between configurations. -
[x] I have read and understand the CONTRIBUTING.md document in this repository.
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
Checklist:
- [x] Existing test suite passes locally with my changes
I don't think that this is the only thing that is preventing Payload from being instantiated more than once. I'm pretty sure there will be other issues to getting this working.
Have you tried in your own project with this change?