Files
2025-07-11 15:25:07 +07:00

26 lines
503 B
TypeScript

import { defineStore } from "pinia";
// project imports
import axios from "@/utils/axios";
export const useContactStore = defineStore('Contact', {
state: () => ({
contacts: [],
}),
getters: {},
actions: {
// Fetch followers from action
async fetchContacts() {
try {
const response = await axios.get("/api/contacts");
this.contacts = response.data.contacts;
} catch (error) {
alert(error);
console.log(error);
}
},
},
});