npm-pkg-hook 1.5.2 → 1.5.4
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/package.json
CHANGED
|
@@ -36,6 +36,12 @@ export const useLogout = ({ setAlertBox = () => {} } = {}) => {
|
|
|
36
36
|
const onClickLogout = async () => {
|
|
37
37
|
try {
|
|
38
38
|
setLoading(true)
|
|
39
|
+
// Eliminar la cookie process.env.SESSION_NAME
|
|
40
|
+
await eliminarCookie(process.env.SESSION_NAME)
|
|
41
|
+
await eliminarCookie(process.env.LOCAL_SALES_STORE)
|
|
42
|
+
await eliminarCookie('restaurant')
|
|
43
|
+
await eliminarCookie('usuario')
|
|
44
|
+
await eliminarCookie('session')
|
|
39
45
|
|
|
40
46
|
// Logout from the server
|
|
41
47
|
const logoutResponse = await fetch(`${process.env.URL_BASE}/api/auth/logout/`, {
|
|
@@ -48,7 +54,6 @@ export const useLogout = ({ setAlertBox = () => {} } = {}) => {
|
|
|
48
54
|
|
|
49
55
|
if (!logoutResponse.ok) {
|
|
50
56
|
setLoading(false)
|
|
51
|
-
// Handle unsuccessful logout request, e.g., show an error message
|
|
52
57
|
return
|
|
53
58
|
}
|
|
54
59
|
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
// Hola mundo
|
|
2
2
|
export const useManageQueryParams = ({
|
|
3
|
-
|
|
3
|
+
location = {
|
|
4
|
+
query: {},
|
|
5
|
+
push: (props, state, { shallow }) => {
|
|
6
|
+
return { ...props, state, shallow }
|
|
7
|
+
}
|
|
8
|
+
}
|
|
4
9
|
} = {}) => {
|
|
5
|
-
|
|
6
10
|
const handleQuery = (name, value = '') => {
|
|
7
|
-
|
|
11
|
+
location.push(
|
|
8
12
|
{
|
|
9
13
|
query: {
|
|
10
|
-
...
|
|
14
|
+
...location.query,
|
|
11
15
|
[name]: value
|
|
12
16
|
}
|
|
13
17
|
},
|
|
@@ -18,10 +22,10 @@ export const useManageQueryParams = ({
|
|
|
18
22
|
|
|
19
23
|
const handleCleanQuery = (name, value = '') => {
|
|
20
24
|
const updatedQuery = {
|
|
21
|
-
...
|
|
25
|
+
...location.query,
|
|
22
26
|
[name]: value || ''
|
|
23
27
|
}
|
|
24
|
-
|
|
28
|
+
location.push(
|
|
25
29
|
{
|
|
26
30
|
query: updatedQuery
|
|
27
31
|
},
|