Sửa lỗi backend để chạy phần đăng ký

This commit is contained in:
2026-06-13 17:41:11 +07:00
parent c08aad3f68
commit 6913bbae48
70 changed files with 1296 additions and 210 deletions
+8 -5
View File
@@ -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 () => {
},
}));