@go-avro/avro-js 0.0.2-beta.145 → 0.0.2-beta.147
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.
|
@@ -220,15 +220,19 @@ export class AvroQueryClient {
|
|
|
220
220
|
const queryClient = this.getQueryClient();
|
|
221
221
|
return useMutation({
|
|
222
222
|
mutationFn: async (cancelToken) => {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
223
|
+
return new Promise((resolve) => {
|
|
224
|
+
this.setAuthState(AuthState.UNAUTHENTICATED);
|
|
225
|
+
this.post('/logout', null, cancelToken).then(() => {
|
|
226
|
+
this.config.authManager.clearCache().then(() => {
|
|
227
|
+
if (this.socket && this.socket.connected) {
|
|
228
|
+
this.socket.disconnect();
|
|
229
|
+
}
|
|
230
|
+
resolve();
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
});
|
|
228
234
|
},
|
|
229
235
|
onSettled: () => {
|
|
230
|
-
this.setAuthState(AuthState.UNAUTHENTICATED);
|
|
231
|
-
this.clearCache();
|
|
232
236
|
queryClient.invalidateQueries();
|
|
233
237
|
},
|
|
234
238
|
onError: (err) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AvroQueryClient } from "../../client/QueryClient";
|
|
2
1
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
2
|
+
import { AvroQueryClient } from "../../client/QueryClient";
|
|
3
3
|
AvroQueryClient.prototype.useCreateProposal = function () {
|
|
4
4
|
return useMutation({
|
|
5
5
|
mutationFn: async ({ job_id, data }) => {
|