Fixed marker-cluster position

This commit is contained in:
PxlLoewe
2025-04-29 21:22:02 -07:00
parent 8d41bdc938
commit 8e79c27444
4 changed files with 24 additions and 36 deletions

View File

@@ -3,6 +3,7 @@ import { MissionOptionalDefaults } from "@repo/db/zod";
import { serverApi } from "helpers/axios";
import { create } from "zustand";
import { toast } from "react-hot-toast";
import axios from "axios";
interface MissionStore {
missions: Mission[];
@@ -17,15 +18,8 @@ export const useMissionsStore = create<MissionStore>((set) => ({
missions: [],
setMissions: (missions) => set({ missions }),
createMission: async (mission) => {
const res = await fetch("/api/mission", {
method: "PUT",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(mission),
});
if (!res.ok) return new Error("Failed to create mission");
const data = await res.json();
const { data } = await serverApi.put<Mission>("/mission", mission);
set((state) => ({ missions: [...state.missions, data] }));
return data;
},