investment page/curency switcher
This commit is contained in:
@ -47,9 +47,6 @@ export const useMapStore = defineStore("mapStore", () => {
|
||||
"se"
|
||||
]);
|
||||
|
||||
const countryList = ref<CountryList[]>()
|
||||
const countries = ref<CountryList[]>()
|
||||
|
||||
// async function getPartnersList() {
|
||||
// try {
|
||||
// const res = await fetch(
|
||||
@ -94,36 +91,11 @@ export const useMapStore = defineStore("mapStore", () => {
|
||||
// }
|
||||
// }
|
||||
|
||||
async function getCountries() {
|
||||
try {
|
||||
const res = await fetch(
|
||||
`http://127.0.0.1:4000/api/public/countries`,
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(`HTTP error: ${res.status}`);
|
||||
}
|
||||
|
||||
const data = await res.json();
|
||||
countries.value = data.ata
|
||||
} catch (error) {
|
||||
console.error("getList error:", error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
partnersList,
|
||||
customersList,
|
||||
// countryList,
|
||||
countries,
|
||||
// getPartnersList,
|
||||
// getCustomerList,
|
||||
getCountries
|
||||
};
|
||||
});
|
||||
|
Reference in New Issue
Block a user