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