Claptrap-ui/src/services/settingsService.ts

20 lines
526 B
TypeScript
Raw Normal View History

2022-06-17 18:08:04 +02:00
import type { SettingDescrition } from "@/data/Setting/SettingDescription";
import { useUserStore } from "@/stores/user";
import axios from "axios";
export function getSettingDescrition() {
return new Promise<SettingDescrition[]>((resole, reject) => {
const userStore = useUserStore();
axios
.get<SettingDescrition[]>("/setting/description", {
headers: {
authorization: `Bearer ${userStore.token}`,
},
})
.then((value) => {
resole(value.data);
});
});
}