Skip to content

Commit 317b3b1

Browse files
committed
🔀 [fix] : conflict resolved
2 parents 2ca56fd + 535d160 commit 317b3b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1072
-494
lines changed

src/api/auth.ts

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ import Cookies from 'js-cookie'
33
import type { loginDataTypes } from '@/types/auth'
44
import { useMemberStore } from '@/stores/member'
55

6-
export const postLogin = async (loginData: loginDataTypes, sessionId: string) => {
7-
const memberStore = useMemberStore()
8-
const response = await axiosInstance.post('/api/auths/login', loginData, {
9-
headers: { sessionId: sessionId }
10-
})
6+
export const postLogin = async (loginData: loginDataTypes) => {
7+
const response = await axiosInstance.post('/api/auths/login', loginData)
118
Cookies.set('accessToken', response.data.accessToken, {
129
path: '/',
1310
sameSite: 'strict'
@@ -16,29 +13,17 @@ export const postLogin = async (loginData: loginDataTypes, sessionId: string) =>
1613
path: '/',
1714
sameSite: 'strict'
1815
})
19-
20-
await memberStore.updateMemberInfoWithToken()
2116
return response.data
2217
}
2318

2419
export const patchPassword = async (password: string) => {
2520
const response = await axiosInstance.patch('/api/members/password', password)
26-
2721
return response.data
2822
}
2923

3024
export const deleteLogout = async () => {
3125
const memberStore = useMemberStore()
32-
const refreshToken = Cookies.get('refreshToken')
33-
34-
const response = await axiosInstance.delete('/api/auths/logout', {
35-
headers: {
36-
Authorization: `Bearer ${import.meta.env.VITE_ACCESS_TOKEN}`,
37-
refreshToken: refreshToken
38-
}
39-
})
40-
Cookies.remove('accessToken', { path: '/' })
41-
Cookies.remove('refreshToken', { path: '/' })
42-
await memberStore.updateMemberInfoWithToken()
43-
return response
26+
memberStore.$reset()
27+
Cookies.remove('accessToken')
28+
Cookies.remove('refreshToken')
4429
}

src/api/common.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { axiosInstance } from '../utils/axios'
1+
import { axiosInstance, formDataAxiosInstance } from '../utils/axios'
2+
3+
export const patchEditInfo = async (formdata: FormData) => {
4+
const response = await formDataAxiosInstance.patch('/api/members/info', formdata)
5+
return response.data
6+
}
27

38
export const getNotification = async (pageNum: number, sizeNum: number) => {
49
const response = await axiosInstance.get(`/api/notifications?page=${pageNum}&size=${sizeNum}`)
@@ -8,13 +13,11 @@ export const getNotification = async (pageNum: number, sizeNum: number) => {
813

914
export const patchNotificationRead = async (notificationId: number) => {
1015
const response = await axiosInstance.patch(`/api/notification/${notificationId}`)
11-
console.log(notificationId)
1216
return response.data
1317
}
1418

1519
export const getNotifiCount = async () => {
1620
const response = await axiosInstance.get(`/api/notifications/count`)
17-
console.log(response.data)
1821
return response.data
1922
}
2023

src/api/user.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,27 @@ export const getHistory = async (taskID: number) => {
5353
}
5454

5555
export const postComment = async (taskID: number, content: string) => {
56-
const response = await axiosInstance.post(`/api/comment/${taskID}`, { content })
56+
const response = await axiosInstance.post(`/api/comments/${taskID}`, { content })
5757
return response.data
5858
}
5959

6060
export const postCommentAttachment = async (taskID: number, formdata: FormData) => {
61-
const response = await formDataAxiosInstance.post(`/api/comment/attachment/${taskID}`, formdata)
61+
const response = await formDataAxiosInstance.post(`/api/comments/attachment/${taskID}`, formdata)
6262
return response.data
6363
}
6464

6565
export const patchComment = async (commentId: number, content: string) => {
66-
const response = await axiosInstance.patch(`/api/comment/${commentId}`, { content })
66+
const response = await axiosInstance.patch(`/api/comments/${commentId}`, { content })
6767
return response.data
6868
}
6969

7070
export const deleteComment = async (commentId: number) => {
71-
const response = await axiosInstance.delete(`/api/comment/${commentId}`)
71+
const response = await axiosInstance.delete(`/api/comments/${commentId}`)
72+
return response.data
73+
}
74+
75+
export const patchTaskRequest = async (taskId: string, formdata: FormData) => {
76+
const response = await formDataAxiosInstance.patch(`/api/tasks/${taskId}`, formdata)
7277
return response.data
7378
}
7479

src/assets/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
body {
1313
font-family: 'SUIT-Variable', sans-serif;
14-
color: #18181B;
14+
color: #18181b;
1515
}
1616

1717
.shadow-custom {

src/components/EditInformation.vue

Lines changed: 70 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,55 +10,62 @@
1010
<div class="profile">
1111
<p class="text-body text-xs font-bold">프로필 사진</p>
1212
<img
13-
v-if="imageUrl"
14-
:src="imageUrl"
13+
v-if="previewUrl || info.profileImageUrl"
14+
:src="previewUrl || info.profileImageUrl"
1515
alt="프로필 이미지"
1616
class="w-24 h-24 rounded-full object-cover border mt-3" />
17-
<div
18-
v-else
19-
class="w-24 h-24 rounded-full bg-background-1 flex items-center justify-center mt-3"></div>
20-
<!-- 파일 업로드 필요 -->
21-
<p class="mt-3 text-xs text-primary1 font-bold cursor-pointer">변경</p>
17+
18+
<label
19+
for="fileInput"
20+
class="mt-3 text-xs text-primary1 font-bold cursor-pointer"
21+
>변경</label
22+
>
23+
<input
24+
id="fileInput"
25+
type="file"
26+
@change="handleFileUpload"
27+
accept="image/*"
28+
class="hidden" />
2229
</div>
2330

2431
<div class="flex flex-col">
2532
<p class="text-body text-xs font-bold">이름</p>
2633
<input
2734
class="input-box h-11 mt-2 text-black"
2835
placeholder="이름을 입력해주세요"
29-
v-model="memberName" />
36+
v-model="info.name" />
3037
</div>
3138
<div class="flex flex-col">
3239
<p class="text-body text-xs font-bold">아이디</p>
33-
<p class="mt-2 text-black">{{ memberId }}</p>
40+
<p class="mt-2 text-black">{{ info.nickname }}</p>
3441
</div>
3542
<div class="flex flex-col">
3643
<p class="text-body text-xs font-bold">이메일</p>
37-
<p class="mt-2 text-black">{{ memberEmail }}</p>
44+
<p class="mt-2 text-black">{{ info.email }}</p>
3845
</div>
3946
<div class="flex flex-col">
4047
<p class="text-body text-xs font-bold">부서</p>
41-
<p class="mt-2 text-black">{{ memberDepartment }}</p>
48+
<p class="mt-2 text-black">{{ info.departmentName }}</p>
4249
</div>
4350
<div class="flex flex-col">
4451
<p class="text-body text-xs font-bold">직무</p>
45-
<p class="mt-2 text-black">{{ memberJob }}</p>
52+
<p class="mt-2 text-black">{{ info.departmentRole }}</p>
4653
</div>
4754
<div>
4855
<p class="text-body text-xs font-bold">알림 수신 여부</p>
4956
<div class="flex flex-col mt-2 gap-2">
5057
<FormCheckbox
51-
v-model="memberForm.isAgitChecked"
58+
v-model="info.notificationSettingInfo.agit"
5259
:checkButtonName="'아지트'"
53-
:isChecked="memberForm.isAgitChecked" />
60+
:isChecked="info.notificationSettingInfo.agit" />
5461
<FormCheckbox
55-
v-model="memberForm.isKakaoWorkChecked"
62+
v-model="info.notificationSettingInfo.kakaoWork"
5663
:checkButtonName="'카카오워크'"
57-
:isChecked="memberForm.isKakaoWorkChecked" />
64+
:isChecked="info.notificationSettingInfo.kakaoWork" />
5865
<FormCheckbox
59-
v-model="memberForm.isEmailChecked"
66+
v-model="info.notificationSettingInfo.email"
6067
:checkButtonName="'이메일'"
61-
:isChecked="memberForm.isEmailChecked" />
68+
:isChecked="info.notificationSettingInfo.email" />
6269
</div>
6370
</div>
6471
<div>
@@ -85,30 +92,59 @@ import ModalView from './ModalView.vue'
8592
import FormButtonContainer from './common/FormButtonContainer.vue'
8693
import FormCheckbox from './common/FormCheckbox.vue'
8794
const router = useRouter()
95+
import { useMemberStore } from '@/stores/member'
96+
import { storeToRefs } from 'pinia'
97+
import { patchEditInfo } from '@/api/common'
8898
89-
const memberName = ref('백지연')
90-
const memberId = ref('Chole.yeon')
91-
const memberEmail = ref('taskflow123@gachon.ac.kr')
92-
const memberDepartment = ref('인프라팀')
93-
const memberJob = ref('인프라 아키텍처')
94-
const imageUrl = ref('')
95-
const isModalVisible = ref(false)
99+
const memberStore = useMemberStore()
100+
const { info } = storeToRefs(memberStore)
101+
102+
const selectedFile = ref<File | null>(null)
103+
const previewUrl = ref<string | null>(null)
96104
97-
const memberForm = ref({
98-
isAgitChecked: false,
99-
isKakaoWorkChecked: false,
100-
isEmailChecked: false
101-
})
105+
const isModalVisible = ref(false)
102106
103107
const handleCancel = () => {
104108
router.back()
105109
}
106110
107-
const handleSubmit = () => {
108-
isModalVisible.value = true
109-
}
110-
111111
const handlePwChange = () => {
112112
router.push('/pw-check')
113113
}
114+
115+
const handleFileUpload = (event: Event) => {
116+
const target = event.target as HTMLInputElement
117+
if (target.files && target.files[0]) {
118+
selectedFile.value = target.files[0]
119+
120+
previewUrl.value = URL.createObjectURL(selectedFile.value)
121+
}
122+
}
123+
124+
const handleSubmit = async () => {
125+
const formData = new FormData()
126+
const memberInfo = {
127+
name: info.value.name,
128+
agitNotification: info.value.notificationSettingInfo.agit,
129+
emailNotification: info.value.notificationSettingInfo.email,
130+
kakaoWorkNotification: info.value.notificationSettingInfo.kakaoWork
131+
}
132+
133+
const jsonMemberInfo = JSON.stringify(memberInfo)
134+
const newBlob = new Blob([jsonMemberInfo], { type: 'application/json' })
135+
136+
formData.append('memberInfo', newBlob)
137+
138+
if (selectedFile.value) {
139+
formData.append('profileImage', selectedFile.value)
140+
}
141+
142+
try {
143+
await patchEditInfo(formData)
144+
isModalVisible.value = true
145+
await memberStore.updateMemberInfoWithToken()
146+
} catch (error) {
147+
console.error('요청 실패:', error)
148+
}
149+
}
114150
</script>

src/components/LineChart.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:options="options" />
66
<NoContent
77
v-else
8-
content="데이터가 없습니다" />
8+
:content="`집계된 ${periodText[periodType]} 데이터가 없습니다`" />
99
</template>
1010

1111
<script setup lang="ts">
@@ -22,6 +22,7 @@ import {
2222
Colors
2323
} from 'chart.js'
2424
import NoContent from './lists/NoContent.vue'
25+
import type { PeriodType } from '@/types/manager'
2526
2627
ChartJS.register(
2728
Title,
@@ -34,12 +35,15 @@ ChartJS.register(
3435
Colors
3536
)
3637
37-
const { labels, series, dataLabel } = defineProps<{
38+
const { labels, series, dataLabel, periodType } = defineProps<{
3839
labels: string[]
3940
series: number[]
4041
dataLabel: string
42+
periodType: PeriodType
4143
}>()
4244
45+
const periodText = { DAY: '일간', WEEK: '주간', MONTH: '월간' }
46+
4347
const teamData = {
4448
labels,
4549
datasets: [

src/components/PieChart.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
:options="options" />
66
<NoContent
77
v-else
8-
content="집계된 데이터가 없습니다" />
8+
:content="
9+
!content && periodType ? `집계된 ${periodText[periodType]} 데이터가 없습니다` : content
10+
" />
911
</template>
1012

1113
<script setup lang="ts">
@@ -21,11 +23,19 @@ import {
2123
type ActiveElement
2224
} from 'chart.js'
2325
import NoContent from './lists/NoContent.vue'
26+
import type { PeriodType } from '@/types/manager'
2427
ChartJS.register(Title, Tooltip, Legend, ArcElement, Colors)
2528
26-
const { labels, series } = defineProps<{ labels: string[]; series: number[] }>()
29+
const { labels, series, periodType, content } = defineProps<{
30+
labels: string[]
31+
series: number[]
32+
periodType?: PeriodType
33+
content?: string
34+
}>()
2735
const emit = defineEmits(['onClick'])
2836
37+
const periodText = { DAY: '일간', WEEK: '주간', MONTH: '월간' }
38+
2939
const teamData = {
3040
labels,
3141
datasets: [

src/components/TopBar.vue

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)