Skip to content

Commit

Permalink
Merge pull request #4259 from apostrophecms/pro-4502-find-options
Browse files Browse the repository at this point in the history
rename projection into options
  • Loading branch information
boutell authored Aug 9, 2023
2 parents f4cff1f + 18cda8c commit f4cb69a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Changes

* Rename misleading `projection` parameter into `options` in `self.find` method signature for
`@apostrophecms/any-doc-type`, `@apostrophecms/any-page-type` & `@apostrophecms/piece-type`.
* Hide save button during in-context editing if the document is autopublished.
* Beginning with this release, the correct `moduleName` for typical
actions on the context document is automatically passed to the
Expand Down
4 changes: 2 additions & 2 deletions modules/@apostrophecms/any-doc-type/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module.exports = {
extend: '@apostrophecms/doc-type',
extendMethods(self) {
return {
find(_super, req, criteria, projection) {
return _super(req, criteria, projection).type(false);
find(_super, req, criteria, options) {
return _super(req, criteria, options).type(false);
}
};
}
Expand Down
4 changes: 2 additions & 2 deletions modules/@apostrophecms/any-page-type/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ module.exports = {

extendMethods(self) {
return {
find(_super, req, criteria, projection) {
return _super(req, criteria, projection).type(false).isPage(true);
find(_super, req, criteria, options) {
return _super(req, criteria, options).type(false).isPage(true);
},
// Returns a MongoDB projection object to be used when querying
// for this type if all that is needed is a title for display
Expand Down
4 changes: 2 additions & 2 deletions modules/@apostrophecms/piece-type/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1164,8 +1164,8 @@ module.exports = {

return browserOptions;
},
find(_super, req, criteria, projection) {
return _super(req, criteria, projection).defaultSort(self.options.sort || { updatedAt: -1 });
find(_super, req, criteria, options) {
return _super(req, criteria, options).defaultSort(self.options.sort || { updatedAt: -1 });
},
newInstance(_super) {
if (!self.options.singletonAuto) {
Expand Down

0 comments on commit f4cb69a

Please sign in to comment.