Skip to content
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

Preserve sort order of list elements #634

Closed
wants to merge 1 commit into from
Closed

Preserve sort order of list elements #634

wants to merge 1 commit into from

Conversation

Darkin8
Copy link
Contributor

@Darkin8 Darkin8 commented Sep 17, 2014

Saving items with partially fetched fields from DB will lead to overwrite of 'sortOrder' field with max value for this field in the list.

Changed behavior:
check for 'sortOrder' field presence in schema.

Saving items with partially fetched fields from DB will lead to overwrite of 'sortOrder' field with max value for this field in the list.

Changed behavior:
check for 'sortOrder' field presence in schema.
@JedWatson
Copy link
Member

Thanks for the fix @Darkin8!

Not sure why the build failed for your PR, but I added a sightly different implementation using keystone.mongoose instead of require('mongoose') to get Schema.Types.Number.

The reason for this is that you can provide a different instance of Mongoose to the one Keystone includes using the keystone.connect method, for edge-cases where the usual require logic fails to find a common package between Keystone and your project (e.g. running with npm link).

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.

2 participants