From cc8489042208345259a5ff5d18e2a1ef82c9df5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaume=20Sol=C3=ADs?= Date: Thu, 16 May 2024 15:47:23 +0200 Subject: [PATCH] cambiar el addItem Localstorage por el AddItemSession para las busquedas de codigos postales --- src/hooks/usePostalCalendar.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hooks/usePostalCalendar.js b/src/hooks/usePostalCalendar.js index e2cffad..cb05037 100644 --- a/src/hooks/usePostalCalendar.js +++ b/src/hooks/usePostalCalendar.js @@ -26,7 +26,7 @@ import { useLocalStorage } from "./useLocalStorage"; export function usePostalCalendar({ modalItem = "", type = "home" }) { const route = useRoute(); const { push } = useRouter(); - const { addItem, getItemSession, removeItem } = useLocalStorage(); + const { addItem, addItemSession, getItemSession, removeItem } = useLocalStorage(); const modalStore = useModalStore(); @@ -151,7 +151,7 @@ export function usePostalCalendar({ modalItem = "", type = "home" }) { const onSuccess = async (values) => { const handleAvailability = async () => { - addItem("availability", { + addItemSession("availability", { postalCode: values.postalCode, dateExpired: invertDate(values.date), }); @@ -168,7 +168,7 @@ export function usePostalCalendar({ modalItem = "", type = "home" }) { const handleHome = async () => { - addItem("availability", { + addItemSession("availability", { postalCode: values.postalCode, dateExpired: invertDate(values.date), }); @@ -191,7 +191,7 @@ export function usePostalCalendar({ modalItem = "", type = "home" }) { const handleProduct = async () => { - addItem("availability", { + addItemSession("availability", { postalCode: values.postalCode, dateExpired: invertDate(values.date), });