refactor: Migrate to Vue components
This commit is contained in:
30
client/js/pages/admin-profile.component.js
Normal file
30
client/js/pages/admin-profile.component.js
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict'
|
||||
|
||||
import * as $ from 'jquery'
|
||||
|
||||
export default {
|
||||
name: 'admin-profile',
|
||||
props: ['email', 'name', 'provider'],
|
||||
data() {
|
||||
return {
|
||||
password: '********',
|
||||
passwordVerify: '********'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
saveUser() {
|
||||
if (this.password !== this.passwordVerify) {
|
||||
//alerts.pushError('Error', "Passwords don't match!")
|
||||
return
|
||||
}
|
||||
$.post(window.location.href, {
|
||||
password: this.password,
|
||||
name: this.name
|
||||
}).done((resp) => {
|
||||
//alerts.pushSuccess('Saved successfully', 'Changes have been applied.')
|
||||
}).fail((jqXHR, txtStatus, resp) => {
|
||||
//alerts.pushError('Error', resp)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user