fix(Bar map / profile): filtered bar where name != null / fix prefgender

This commit is contained in:
Laurian-Dufrechou
2023-05-08 17:49:14 +02:00
parent db8e513ceb
commit c84fc2886d
3 changed files with 15 additions and 10 deletions
+7 -1
View File
@@ -20,6 +20,7 @@ export default function Map() {
const toast = useToast({ position: "bottom" });
const idSaveToast = "saved_location";
const { data: session, status } = useSession();
const [listBars, setListBars] = useState({} as unknown as any);
const {
isLoading,
@@ -43,7 +44,7 @@ export default function Map() {
});
const {
data: listBars,
data,
isError: isErrorListBars,
isLoading: isLoadingListBars,
error: errorListBars,
@@ -71,6 +72,11 @@ export default function Map() {
return err;
});
},
onSuccess: (data) => {
// filter data where name is not null
const filteredData = data.filter((bar: any) => bar.name !== null);
setListBars(filteredData);
},
});
const userSetLocation = useMutation({