Skip to content

Commit 7623db8

Browse files
committed
🐛 [fix] 잘못된 아이디 형식 요청 방지
1 parent fecd55f commit 7623db8

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/components/common/EditInformation.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ const handleSubmit = async () => {
290290
291291
await patchEditInfo(formData)
292292
isModalVisible.value = true
293+
await memberStore.updateMemberInfoWithToken()
293294
}
294295
}
295296
</script>

src/components/request-task/RequestTaskInput.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<p v-if="isInvalidateState === 'noCode'">작업코드를 입력해주세요</p>
1010
<p v-if="isInvalidateState === 'code'">사용할 수 없는 작업코드입니다</p>
1111
<p v-if="isInvalidateState === 'categoryName'">카테고리명을 입력해주세요</p>
12+
<p v-if="isInvalidateState === 'wrongNickname'">잘못된 형식의 아이디입니다</p>
1213
</div>
1314
<input
1415
class="w-full h-11 border border-border-1 px-4 focus:outline-none rounded"

src/components/user-manage/UserRegistration.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<script lang="ts" setup>
5959
import { addMemberAdmin } from '@/api/admin'
6060
import { INITIAL_USER_REGISTRATION, RoleKeys, RoleTypeMapping } from '@/constants/admin'
61-
import { computed, onMounted, ref } from 'vue'
61+
import { computed, onMounted, ref, watch } from 'vue'
6262
import { useRouter } from 'vue-router'
6363
import FormButtonContainer from '../common/FormButtonContainer.vue'
6464
import FormCheckbox from '../common/FormCheckbox.vue'
@@ -84,8 +84,14 @@ const handleCancel = () => {
8484
router.back()
8585
}
8686
87+
const usernameRegex = /^[a-z]{3,10}\.[a-z]{1,5}$/
88+
8789
const handleSubmit = async () => {
8890
try {
91+
if (!usernameRegex.test(userRegistrationForm.value.nickname)) {
92+
isInvalidate.value = 'wrongNickname'
93+
return
94+
}
8995
const formData = {
9096
...userRegistrationForm.value,
9197
isReviewer: isManager.value ? userRegistrationForm.value.isReviewer : false,
@@ -104,4 +110,8 @@ const handleSubmit = async () => {
104110
}
105111
}
106112
}
113+
114+
watch(isManager, () => {
115+
userRegistrationForm.value.isReviewer = false
116+
})
107117
</script>

0 commit comments

Comments
 (0)