You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* refactor(set-field hooks): Handle 'as' field startsWith data and type array
To handle multi: true , create method. The data is in array format. Add
logic to loop and apply the 'as' field to each array of object.
* refactor(set-field): revert changes, update documentation
* docs(setField): Update note for the setField
When dealing with data that is array type, setField result may not
working as expected result.
Co-authored-by: TEO KIAT LOONG <[email protected]>
<p class="tip">The services in all these examples are assumed, for simplicity, to have pagination disabled. You will have to decide when to use `paginate:false` in your code.</p>
> __Note:__ The keepQuery hook will remove any fields not specified even if the service is being called from the server. You may want to condition the hook to run only for external transports, e.g. `iff(isProvider('external'), keepQuery(...))`.
1074
1074
1075
1075
- Arguments
@@ -1103,7 +1103,7 @@ Keep certain fields in a nested array inside the query object, deleting the rest
> __Note:__ The keepQueryInArray hook will remove any fields not specified even if the service is being called from the server. You may want to condition the hook to run only for external transports, e.g. `iff(isProvider('external'), keepQueryInArray(...))`.
1108
1108
1109
1109
- Arguments
@@ -1148,7 +1148,7 @@ Convert certain field values to lower case.
@@ -1697,6 +1697,8 @@ The `setField` hook allows to set a field on the hook context based on the value
1697
1697
1698
1698
> __Important:__ This hook should be used after the [authenticate hook](https://docs.feathersjs.com/api/authentication/hook.html#authenticate-options) when accessing user fields (from `params.user`).
1699
1699
1700
+
__Note:__ When the service enable `multi:true` and `data` is an array data type, this hook may working to an unexpected result
1701
+
1700
1702
### Examples
1701
1703
1702
1704
Limit all external access of the `users` service to the authenticated user:
@@ -1814,7 +1816,7 @@ Set slugs in URL, e.g. /stores/:storeId.
0 commit comments