+
-
diff --git a/src/components/projectlist/ProjectList.vue b/src/components/projectlist/ProjectList.vue
index 5c66e48..e63684c 100644
--- a/src/components/projectlist/ProjectList.vue
+++ b/src/components/projectlist/ProjectList.vue
@@ -11,9 +11,9 @@
name="name"
:is-essential="true"
:is-alert="nameAlert"
- @update:alert="nameAlert = $event"
- :value="name"
+ @update:modelValue="name = $event"
/>
+
@@ -76,33 +69,37 @@
import ProjectCardList from '@c/list/ProjectCardList.vue';
import CategoryBtn from '@c/category/CategoryBtn.vue';
import commonApi from '@/common/commonApi';
- import { inject, ref } from 'vue';
+ import { inject, onMounted, ref } from 'vue';
import WriteBtn from '../button/WriteBtn.vue';
import CenterModal from '../modal/CenterModal.vue';
import FormSelect from '../input/FormSelect.vue';
import FormInput from '../input/FormInput.vue';
import ArrInput from '../input/ArrInput.vue';
import { useToastStore } from '@s/toastStore';
+ import $api from '@api';
+ import { useUserInfoStore } from '@/stores/useUserInfoStore';
const dayjs = inject('dayjs');
const today = dayjs().format('YYYY-MM-DD');
const toastStore = useToastStore();
+ const userStore = useUserInfoStore();
+
+ const user = ref(null);
const name = ref('');
const color = ref('');
const address = ref('');
const detailAddress = ref('');
const postcode = ref('');
- const startDay = ref('');
+ const startDay = ref(today);
const endDay = ref('');
const description = ref('');
const isModalOpen = ref(false);
const nameAlert = ref(false);
const addressAlert = ref(false);
- const startDayAlert = ref(false);
const openModal = () => {
isModalOpen.value = true;
@@ -128,26 +125,37 @@
postcode.value = addressData.postcode;
};
- const handleSubmit = () => {
- addressAlert.value = address.value.trim() === '';
+
+ onMounted(async () => {
+ await userStore.userInfo(); // 로그인한 사용자 정보
+ user.value = userStore.user;
+ });
+
+ const handleSubmit = async () => {
+
nameAlert.value = name.value.trim() === '';
- startDayAlert.value = startDay.value.trim() === '';
+ addressAlert.value = address.value.trim() === '';
+
+ if (nameAlert.value || addressAlert.value ) {
+ return;
+ }
$api.post('project/insert', {
projctNam: name.value,
- projctCol: color.value,
- projctCdt: startDay.value,
- projctEdt: endDay.value,
- projctDes: description.value,
+ projctCol: String(color.value),
+ projctStr: startDay.value,
+ projctEnd: endDay.value || null,
+ projctDes: description.value || null,
projctAdd: address.value,
projctDtl: detailAddress.value,
projctZip: postcode.value,
-
+ projctCmb: user.value.name,
})
.then(res => {
if (res.status === 200) {
toastStore.onToast('프로젝트가 등록되었습니다.', 's');
closeModal();
+ location.reload();
}
})
};