Skip to content

Commit

Permalink
fix: prevent showing reservation as active user's reservation when us…
Browse files Browse the repository at this point in the history
…er is member of location
  • Loading branch information
ArcoMul committed Jun 9, 2024
1 parent f1d3610 commit 48b32e5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/stores/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ export const useUserStore = defineStore<"user", State>("user", {
},
async fetchUserReservations() {
const { pb } = usePocketbase();
const reservations = await pb.collection("reservations").getFullList();
this.reservations = reservations;
if (pb.authStore?.model?.id) {
const reservations = await pb.collection("reservations").getFullList({
filter: pb.filter("user = {:user}", {
user: pb.authStore.model.id,
}),
});
this.reservations = reservations;
}
},
setReservationIntent(locationSlug: string, productId: string) {
this.reservationIntent.locationSlug = locationSlug;
Expand Down

0 comments on commit 48b32e5

Please sign in to comment.