This commit is contained in:
2023-07-30 02:15:19 +08:00
parent 58b939f72e
commit 277a919436
28 changed files with 807 additions and 99 deletions

View File

@@ -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"));