Files
ghatreh_user/src/store/walletStore.ts
T

19 lines
469 B
TypeScript
Raw Normal View History

2026-07-01 22:29:18 +03:30
import { ref } from 'vue'
2025-10-05 09:44:14 +03:30
import {defineStore} from "pinia";
import type {Wallet} from "@/models/wallet";
import {getWallet} from "@/api/wallet";
export const useWalletStore = defineStore('wallet', () => {
const walletInfo = ref<Wallet | undefined>(undefined)
async function getMyWallet() {
try {
walletInfo.value = await getWallet()
return walletInfo.value
} catch (e) {
console.log(e)
}
}
2026-07-01 22:29:18 +03:30
return { walletInfo, getMyWallet }
2025-10-05 09:44:14 +03:30
})