tethys.backend/resources/js/Stores/map.service.ts
Arno Kaimbacher f403c3109f
All checks were successful
CI Pipeline / japa-tests (push) Successful in 54s
- add methods for releasing datasets from submitter
- npm updates
- side menu with child items
- flash messages via HttpContext response (extended via macro)
2023-06-27 18:23:18 +02:00

41 lines
979 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) {
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) {
this.mapService.set(id, map);
},
hasMap(id: string): boolean {
return this.mapService.has(id);
},
deleteMap(id: string): boolean {
return this.mapService.delete(id);
},
},
});