@dartcom/ui-kit 3.8.2 → 3.8.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/dist/index.cjs
CHANGED
|
@@ -61547,13 +61547,13 @@ const encodeString = (string) => {
|
|
|
61547
61547
|
const useSignIn = () => {
|
|
61548
61548
|
return useMutation({
|
|
61549
61549
|
mutationKey: ['sign-in'],
|
|
61550
|
-
mutationFn: ({ body: { username, password } }) => {
|
|
61550
|
+
mutationFn: async ({ body: { username, password } }) => {
|
|
61551
61551
|
const values = {
|
|
61552
61552
|
username,
|
|
61553
61553
|
password: encodeString(password),
|
|
61554
61554
|
};
|
|
61555
61555
|
const body = Object.keys(values).reduce((request, key, index) => `${request}${index === 0 ? '' : '&'}${key}=${values[key]}`, '');
|
|
61556
|
-
|
|
61556
|
+
const response = await GlobalConfig.instance.apiService.post({
|
|
61557
61557
|
url: 'token',
|
|
61558
61558
|
body,
|
|
61559
61559
|
config: {
|
|
@@ -61562,6 +61562,7 @@ const useSignIn = () => {
|
|
|
61562
61562
|
},
|
|
61563
61563
|
},
|
|
61564
61564
|
});
|
|
61565
|
+
return response;
|
|
61565
61566
|
},
|
|
61566
61567
|
});
|
|
61567
61568
|
};
|
|
@@ -61576,11 +61577,7 @@ const useLogout = () => {
|
|
|
61576
61577
|
return response;
|
|
61577
61578
|
},
|
|
61578
61579
|
onError: showErrorSnackbar,
|
|
61579
|
-
onSuccess: () => {
|
|
61580
|
-
queryClient.invalidateQueries({
|
|
61581
|
-
queryKey: ['user'],
|
|
61582
|
-
});
|
|
61583
|
-
},
|
|
61580
|
+
onSuccess: () => { },
|
|
61584
61581
|
});
|
|
61585
61582
|
};
|
|
61586
61583
|
|