5151 <AccountInput
5252 v-bind:name =" 'Password'"
5353 v-bind:type =" 'password'"
54- v-on:saveSingleChoice = " saveSingleChoice "
54+ v-on:saveSingleChoiceOldGiven = " saveSingleChoiceOldGiven "
5555 v-bind:currentValuePassed =" ''" ></AccountInput >
5656 </section >
5757 <section v-if =" getShow === 'profile'" class =" flex flex-col items-start z-10 absolute bg-white-matcha w-full top-0 left-0 md:ml-4 md:relative md:shadow-md md:rounded-md" >
@@ -233,11 +233,9 @@ export default {
233233 } else if (key === ' lastName' ) {
234234 await this .$http .patch (' /profile/edit/last_name' , { last_name: value });
235235 } else if (key === ' email' ) {
236- await this .$http .patch (' /profile/edit/email' , { email: value });
236+ await this .$http .put (' /profile/edit/email' , { email: value });
237237 } else if (key === ' username' ) {
238238 await this .$http .patch (' /profile/edit/username' , { username: value });
239- } else if (key === ' password' ) {
240- await this .$http .patch (' /profile/edit/password' , { password: value });
241239 } else if (key === ' bio' ) {
242240 await this .$http .patch (' /profile/edit/bio' , { bio: value });
243241 } else if (key === ' gender' ) {
@@ -248,6 +246,15 @@ export default {
248246 const user = await this .$http .get (` /users/${ this .$store .getters .getLoggedInUser .id } ` );
249247 await this .$store .dispatch (' login' , user .data );
250248 },
249+ async saveSingleChoiceOldGiven (... args ) {
250+ const [key , value , old ] = args;
251+ if (key === ' password' ) {
252+ await this .$http .put (' /profile/edit/password' , {
253+ old_password: old,
254+ new_password: value,
255+ });
256+ }
257+ },
251258 async saveMultipleChoice (... args ) {
252259 const [key , value ] = args;
253260 if (key === ' interests' ) {
0 commit comments