File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,6 +46,6 @@ export const getMemberDetailAdmin = async (id: string) => {
4646}
4747
4848export const updateMemberAdmin = async ( id : string , data : UserUpdateValue ) => {
49- const response = await axiosInstance . post ( `api/managements/members/${ id } ` , data )
49+ const response = await axiosInstance . patch ( `api/managements/members/${ id } ` , data )
5050 return response . data
5151}
Original file line number Diff line number Diff line change 88 </ModalView >
99 <RequestTaskInput
1010 v-model =" userRegistrationForm.name"
11+ :is-invalidate =" isInvalidate"
1112 :placeholderText =" '회원의 이름을 입력해주세요'"
1213 :labelName =" '이름'" />
1314 <RequestTaskInput
@@ -113,8 +114,23 @@ const handleCancel = async () => {
113114 router .back ()
114115}
115116
117+ const usernameRegex = / ^ [a-z ] {3,10} \. [a-z ] {1,5} $ /
118+ const emailRegex = / ^ @[a-zA-Z0-9 -] + (?:\. [a-zA-Z0-9 -] + )+ $ /
119+
116120const handleSubmit = async () => {
117121 try {
122+ if (! userRegistrationForm .value .name ) {
123+ isInvalidate .value = ' nameEmpty'
124+ return
125+ }
126+ if (! usernameRegex .test (userRegistrationForm .value .nickname )) {
127+ isInvalidate .value = ' wrongNickname'
128+ return
129+ }
130+ if (! emailRegex .test (userRegistrationForm .value .email )) {
131+ isInvalidate .value = ' wrongEmail'
132+ return
133+ }
118134 if (typeof userId .value === ' string' ) {
119135 const userData = {
120136 role: RoleTypeMapping [userRegistrationForm .value .role ],
@@ -123,6 +139,7 @@ const handleSubmit = async () => {
123139 departmentId: userRegistrationForm .value .departmentId ,
124140 departmentRole: userRegistrationForm .value .departmentRole
125141 }
142+
126143 await updateMemberAdmin (userId .value , userData )
127144 isModalVisible .value = true
128145 }
You can’t perform that action at this time.
0 commit comments