parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

ParseQuery.order is missing in beforeFind hook

Open virtualtoy opened this issue 7 years ago • 3 comments

Is your feature request related to a problem? Please describe. When I access query in beforeFind hook I cannot access order information.

Describe the solution you'd like I would like to be able to retrieve order information.

Describe alternatives you've considered So far I see no alternatives to this problem for now.

Additional context Possible solution is to add order information data in file src/triggers.js (not sure about implications, seems pretty straightforward):

@@ -460,6 +460,9 @@ export function maybeRunQueryTrigger(
     if (restOptions.limit) {
       parseQuery._limit = restOptions.limit;
     }
+    if (restOptions.order) {
+      parseQuery._order = restOptions.order.split(',');
+    }
     count = !!restOptions.count;
   }
   const requestObject = getRequestQueryObject(

virtualtoy avatar Oct 28 '19 12:10 virtualtoy

Sounds like a good idea. Would you like to open a PR for this?

dplewis avatar Oct 28 '19 18:10 dplewis

@virtualtoy There are a few query fields missing. If you want to get started, add your test cases here and read the Contributor's Guide to run your tests

dplewis avatar Oct 29 '19 00:10 dplewis

@dplewis I'd like to but looks like I cannot run tests on windows. Let me resolve issue with tests first

virtualtoy avatar Oct 29 '19 02:10 virtualtoy