Sửa lỗi backend để chạy phần đăng ký
This commit is contained in:
Vendored
+8
-5
@@ -1,10 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.useTourStore = void 0;
|
||||
const zustand_1 = require("zustand");
|
||||
exports.useTourStore = (0, zustand_1.create)((set, get) => ({
|
||||
import { create } from 'zustand';
|
||||
export const useTourStore = create((set, get) => ({
|
||||
currentTour: null,
|
||||
legs: [],
|
||||
publicTours: [],
|
||||
userRole: null,
|
||||
setTour: (tour) => set({ currentTour: tour }),
|
||||
updateLegs: (legs) => set({ legs }),
|
||||
@@ -15,6 +13,11 @@ exports.useTourStore = (0, zustand_1.create)((set, get) => ({
|
||||
const role = data.members?.find((m) => m.userId === currentUserId)?.role || 'VIEWER_EXTERNAL';
|
||||
set({ currentTour: data, legs: data.legs || [], userRole: role });
|
||||
},
|
||||
fetchPublicTours: async () => {
|
||||
const response = await fetch(`http://localhost:3001/api/v1/tours/explore`);
|
||||
const data = await response.json();
|
||||
set({ publicTours: data });
|
||||
},
|
||||
optimizeRouting: async () => {
|
||||
},
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user