프로젝트 store 생성

This commit is contained in:
yoon 2025-02-27 11:06:25 +09:00
parent a7c27a19e4
commit bbaf744b45

View File

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