Skip to content

Commit

Permalink
rename projection into options
Browse files Browse the repository at this point in the history
  • Loading branch information
haroun committed Aug 8, 2023
1 parent f4cff1f commit 18cda8c
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 18cda8c

Please sign in to comment.