Arno Kaimbacher
296c8fd46e
Some checks failed
CI Pipeline / japa-tests (push) Failing after 1m13s
- renamed middleware Role and Can to role_middleware and can_middleware - added some typing for inertia vue3 components - npm updates
41 lines
1022 B
TypeScript
41 lines
1022 B
TypeScript
import { defineStore } from 'pinia';
|
|
// import axios from 'axios';
|
|
|
|
export const MapService = defineStore('map', {
|
|
state: () => ({
|
|
// dataset: {} as Dataset,
|
|
|
|
mapService: new Map<string, any>(),
|
|
}),
|
|
actions: {
|
|
// payload = authenticated user
|
|
// setUser(payload: any) {
|
|
// if (payload.name) {
|
|
// this.userName = payload.name;
|
|
// }
|
|
// if (payload.email) {
|
|
// this.userEmail = payload.email;
|
|
// }
|
|
// if (payload.avatar) {
|
|
// this.userAvatar = payload.avatar;
|
|
// }
|
|
// },
|
|
|
|
getMap(id: string) {
|
|
return this.mapService.get(id);
|
|
},
|
|
|
|
setMap(id: string, map: any) {
|
|
this.mapService.set(id, map);
|
|
},
|
|
|
|
hasMap(id: string): boolean {
|
|
return this.mapService.has(id);
|
|
},
|
|
|
|
deleteMap(id: string): boolean {
|
|
return this.mapService.delete(id);
|
|
},
|
|
},
|
|
});
|