vue-api-query icon indicating copy to clipboard operation
vue-api-query copied to clipboard

feat(model): add method wrapper to define the api response wrapper / overrides

Open JRogaishio opened this issue 1 year ago • 0 comments

Checklist

  • [x] Tests
  • [x] Docs
  • [x] Type definitions

Changes:

  • Added wrap and _unwrap methods to Model.js to mimic Laravel's resource data wrapping. This makes for $first, $find, $get, and $all obsolete but I kept them for backward compatibility. The the overloadable wrap() allows you to automatically unwrap using the standard first, find, get, all methods but also change what the wrapper key is in case you don't want to use the standard 'data' property
  • Lock the defu package to 6.1.2. Version 6.1.3+ has a regression that prevents exported objects from merging with plain objects.
  • Added unit tests for the new wrap() method
  • Added new wrap() type
  • Updated documentation for new wrap() type

JRogaishio avatar Oct 04 '24 13:10 JRogaishio