@confighub/rtk-query 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -99,7 +99,8 @@ field. There is one content hash, `DataHash`; `ContentHash` and `RevisionHash` a
|
|
|
99
99
|
the auth provider.
|
|
100
100
|
- The api is a module singleton, so `baseUrl`/`getToken` are set at configure time, not
|
|
101
101
|
per instance — the one ergonomic difference from `@confighub/api`.
|
|
102
|
-
- A 401 calls your `onUnauthorized` (if provided); it does not redirect.
|
|
102
|
+
- A 401 calls your `onUnauthorized` (if provided); it does not redirect. A 403 calls your
|
|
103
|
+
`onForbidden` with the error, whose `data.message` says why.
|
|
103
104
|
- Peer deps: `@reduxjs/toolkit`, `react`, `react-redux`.
|
|
104
105
|
- Endpoints and types are generated from the spec of the ConfigHub server whose version
|
|
105
106
|
the package carries, by `@rtk-query/codegen-openapi`.
|
package/dist/index.cjs
CHANGED
|
@@ -47,6 +47,9 @@ var baseQuery = async (args, api, extraOptions) => {
|
|
|
47
47
|
if (result.error && result.error.status === 401) {
|
|
48
48
|
await config.onUnauthorized?.();
|
|
49
49
|
}
|
|
50
|
+
if (result.error && result.error.status === 403) {
|
|
51
|
+
await config.onForbidden?.(result.error);
|
|
52
|
+
}
|
|
50
53
|
return result;
|
|
51
54
|
};
|
|
52
55
|
var confighubApi = react.createApi({
|