프로젝트 store 생성
This commit is contained in:
parent
a7c27a19e4
commit
bbaf744b45
@ -12,19 +12,16 @@ import $api from '@api';
|
||||
export const useProjectStore = defineStore('project', () => {
|
||||
const projectList = ref([]);
|
||||
|
||||
const getProjectList = async (searchText, selectedYear) => {
|
||||
try {
|
||||
const res = await $api.get('project/select', {
|
||||
params: {
|
||||
searchKeyword: searchText,
|
||||
category: selectedYear,
|
||||
},
|
||||
});
|
||||
projectList.value = res.data.data.projectList;
|
||||
} catch (error) {
|
||||
console.error('프로젝트 목록 조회 실패:', error);
|
||||
}
|
||||
const getProjectList = async (searchText = '', selectedYear = '') => {
|
||||
const res = await $api.get('project/select', {
|
||||
params: {
|
||||
searchKeyword: searchText || '',
|
||||
category: selectedYear || '',
|
||||
},
|
||||
});
|
||||
projectList.value = res.data.data.projectList;
|
||||
};
|
||||
|
||||
|
||||
return { projectList, getProjectList };
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user