Add (v1)
This commit is contained in:
@@ -10,6 +10,7 @@ export const usePostStore = defineStore("postStore", {
|
||||
defaultLocaleSlug: "my",
|
||||
countryLocales: [],
|
||||
localeCategories: [],
|
||||
authors: [],
|
||||
},
|
||||
}),
|
||||
getters: {
|
||||
@@ -22,8 +23,21 @@ export const usePostStore = defineStore("postStore", {
|
||||
localeCategories(state) {
|
||||
return state.data.localeCategories;
|
||||
},
|
||||
authors(state) {
|
||||
return state.data.authors;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async fetchAuthors() {
|
||||
try {
|
||||
const response = await axios.get(route("api.admin.authors"));
|
||||
console.log(response);
|
||||
this.data.authors = response.data.authors;
|
||||
} catch (error) {
|
||||
// alert(error);
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
async fetchCountryLocales() {
|
||||
try {
|
||||
const response = await axios.get(route("api.admin.country-locales"));
|
||||
|
||||
Reference in New Issue
Block a user