update
This commit is contained in:
No files matched your search
+22
-20
@@ -1,23 +1,25 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { defineStore } from "pinia";
|
||||
// project imports
|
||||
import axios from '@/utils/axios';
|
||||
import axios from "@/utils/axios";
|
||||
|
||||
export const useContactStore = defineStore({
|
||||
id: '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);
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user