profil: review changes incorporated from Moritz

This commit is contained in:
ogerly 2021-06-02 16:54:50 +02:00
parent 75df0ad4ea
commit 2250fea339
6 changed files with 14 additions and 38 deletions

View File

@ -99,26 +99,6 @@ const loginAPI = {
return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload)
},
// `POST http://localhost/login_api/getUserInfos`
//
// with:
//
// ```json
// {
// "session_id": -127182,
// "email": "max.musterman@gmail.de",
// "ask": [
// "EmailVerificationCode.Register",
// "loginServer.path",
// "user.pubkeyhex",
// "user.first_name",
// "user.last_name",
// "user.disabled",
// "user.email_checked",
// "user.language"
// ]
// }
changePassword: async (sessionId, email, password) => {
const payload = {
session_id: sessionId,
@ -129,7 +109,7 @@ const loginAPI = {
}
return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload)
},
changePasswordProfil: async (sessionId, email, password, passwordNew) => {
changePasswordProfile: async (sessionId, email, password, passwordNew) => {
const payload = {
session_id: sessionId,
email,
@ -140,7 +120,7 @@ const loginAPI = {
}
return apiPost(CONFIG.LOGIN_API_URL + 'updateUserInfos', payload)
},
changeUsernameProfil: async (sessionId, email, usernameNew) => {
changeUsernameProfile: async (sessionId, email, usernameNew) => {
const payload = {
session_id: sessionId,
email,

View File

@ -105,9 +105,6 @@
"add_work":"neuer Gemeinschaftsbeitrag"
},
"profil": {
"edit": {
},
"activity": {
"chart":"Gemeinschaftsstunden Chart",
"new":"Neue Gemeinschaftsstunden eintragen",

View File

@ -28,7 +28,7 @@
{{ userdata.first_name }}
</b-col>
<b-col v-else class="col-md-9 col-sm-10">
<b-input type="text" v-model="form.first_name"></b-input>
<b-input type="text" v-model="form.firstName"></b-input>
</b-col>
</b-row>
<b-row class="mb-3">
@ -39,7 +39,7 @@
{{ userdata.last_name }}
</b-col>
<b-col v-else class="col-md-9 col-sm-10">
<b-input type="text" v-model="form.last_name"></b-input>
<b-input type="text" v-model="form.lastName"></b-input>
</b-col>
</b-row>
<b-row class="mb-3">
@ -67,11 +67,11 @@ export default {
data() {
return {
edit_userdata: true,
sessionId: null,
sessionId: this.$store.state.sessionId,
email: null,
form: {
first_name: this.userdata.first_name,
last_name: this.userdata.last_name,
firstName: this.userdata.first_name,
lastName: this.userdata.last_name,
desc: this.UserProfileTestData.desc,
},
}

View File

@ -25,7 +25,7 @@
</b-col>
<b-col v-if="edit_email" class="col-md-9 col-sm-10">{{ $store.state.email }}</b-col>
<b-col v-else class="col-md-9 col-sm-10">
<b-input type="text" v-model="$store.state.email"></b-input>
<b-input type="text" v-model="newEmail"></b-input>
</b-col>
</b-row>
</b-container>
@ -39,16 +39,16 @@ export default {
data() {
return {
edit_email: true,
newEmail: '',
}
},
methods: {
async onSubmit() {
// console.log(this.data)
const result = await loginAPI.changeEmailProfil(
this.sessionId,
this.$store.state.sessionId,
this.email,
this.password,
this.passwordNew,
this.newEmail,
)
if (result.success) {
alert('changePassword success')

View File

@ -68,7 +68,6 @@ export default {
data() {
return {
edit_pwd: true,
sessionId: null,
email: null,
password: '',
passwordNew: '',
@ -78,8 +77,8 @@ export default {
methods: {
async onSubmit() {
// console.log(this.data)
const result = await loginAPI.changePasswordProfil(
this.sessionId,
const result = await loginAPI.changePasswordProfile(
this.$store.state.sessionId,
this.email,
this.password,
this.passwordNew,

View File

@ -54,7 +54,7 @@ export default {
methods: {
async onSubmit() {
// console.log(this.data)
const result = await loginAPI.changeUsernameProfil(this.username)
const result = await loginAPI.changeUsernameProfile(this.username)
if (result.success) {
alert('changeUsername success')
} else {