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
The redirectTo side effect, when declared via an action meta, relies on the presence of a basePath field in the meta, too:
exportconstcrudGetOne=(resource: string,id: Identifier,basePath: string,refresh: RefreshSideEffect=true): CrudGetOneAction=>({type: CRUD_GET_ONE,payload: { id },meta: {
resource,fetch: GET_ONE,
basePath,// <= this one is only there because of redirectTo belowonFailure: {notification: {body: 'ra.notification.item_doesnt_exist',level: 'warning',},redirectTo: 'list',
refresh,},},});
There is no real justification for that, and it doesn't make sense. No other side effect than the redirectTo saga uses that basePath field.
As it adds special cases in the options management, I suggest we move the basePath data where in belongs, in the redirectTo side effect:
With side effects as hooks (#3425), we no longer need to pass basePath in the metas. But we don't need to remove them either: the change is backwards compatible!
The
redirectTo
side effect, when declared via an action meta, relies on the presence of abasePath
field in the meta, too:There is no real justification for that, and it doesn't make sense. No other side effect than the
redirectTo
saga uses thatbasePath
field.As it adds special cases in the options management, I suggest we move the
basePath
data where in belongs, in theredirectTo
side effect:This is a BC for people using actions with custom side effects.
The text was updated successfully, but these errors were encountered: