-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(ui): moves folder rendering from the client to the server #12710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get all the way through this.
* This will ensure that prefs are only updated when explicitly set by the user | ||
* This could potentially be done by injecting a `sessionID` into the params and comparing it against a session cookie | ||
*/ | ||
const browseByFolderPreferences = await upsertPreferences<{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the right way to do this, new ServerFunction perhaps?
}) | ||
} catch (error) { | ||
// eslint-disable-next-line no-console | ||
console.error('Error moving items:', error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this have toast the error instead of swallowing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider the couple places you had console.error adding toast. Otherwise it looks good to me.
🚀 This is included in version v3.43.0 |
Moves folder rendering for
collection-folders
view,browse-by-folders
view and themove-to-folder
drawer. This is how the rest of payload behaves, following this same paradigm allows the feature to integrate well with other things such as the multi-tenant plugin.