ff-admin/src/stores/configuration.ts

35 lines
976 B
TypeScript
Raw Normal View History

2025-04-24 16:49:14 +02:00
import { defineStore } from "pinia";
2025-05-07 09:20:32 +02:00
import { http } from "@/serverCom";
2025-04-24 16:49:14 +02:00
export const useConfigurationStore = defineStore("configuration", {
state: () => {
return {
clubName: "",
clubImprint: "",
clubPrivacy: "",
clubWebsite: "",
appCustom_login_message: "",
2025-04-25 08:18:27 +02:00
appShow_link_to_calendar: false as boolean,
2025-04-29 13:10:30 +02:00
serverOffline: false as boolean,
2025-04-24 16:49:14 +02:00
};
},
actions: {
configure() {
http
.get("/public/configuration")
.then((res) => {
this.clubName = res.data["club.name"];
this.clubImprint = res.data["club.imprint"];
this.clubPrivacy = res.data["club.privacy"];
this.clubWebsite = res.data["club.website"];
this.appCustom_login_message = res.data["app.custom_login_message"];
this.appShow_link_to_calendar = res.data["app.show_link_to_calendar"];
})
2025-04-29 13:10:30 +02:00
.catch(() => {
this.serverOffline = true;
});
2025-04-24 16:49:14 +02:00
},
},
});