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

feat: Allow short circuit of beforeFind

Open EmpiDev opened this issue 5 months ago • 7 comments
trafficstars

Pull Request

Issue

Closes: https://github.com/parse-community/parse-server/issues/8693

Approach

This PR continues and supersedes #8694 by @dblythy. Adds ability to return objects (or an empty array) from a beforeFind trigger.

Tasks

  • [x] Add tests

Summary by CodeRabbit

  • New Features
    • Improved support for returning objects or arrays of objects directly from cloud triggers, allowing for more flexible query responses.
  • Bug Fixes
    • Ensured that objects returned from triggers are handled correctly without unnecessary conversions.
  • Tests
    • Added comprehensive tests to verify the behavior of triggers returning objects or arrays, including unsaved objects and empty results.
  • Refactor
    • Centralized trigger handling for find and get operations to ensure consistent execution and security enforcement.
    • Enhanced trigger processing with improved parameter handling, JSON serialization, and query construction for better robustness and clarity.

EmpiDev avatar May 27 '25 09:05 EmpiDev