accounts-frontend/src/services/api/accounts.js

61 lines
1.2 KiB
JavaScript
Raw Normal View History

import request from 'services/request';
export default {
current() {
return request.get('/api/accounts/current');
},
changePassword({
password = '',
newPassword = '',
newRePassword = '',
logoutAll = true
}) {
return request.post(
'/api/accounts/change-password',
{password, newPassword, newRePassword, logoutAll}
);
2016-05-02 18:43:18 +05:30
},
changeUsername({
username = '',
password = ''
}) {
return request.post(
'/api/accounts/change-username',
{username, password}
);
2016-05-20 01:11:43 +05:30
},
changeLang(lang) {
return request.post(
'/api/accounts/change-lang',
{lang}
);
},
requestEmailChange({password = ''}) {
return request.post(
'/api/accounts/change-email/initialize',
{password}
);
},
setNewEmail({
email = '',
key = ''
}) {
return request.post(
'/api/accounts/change-email/submit-new-email',
{email, key}
);
},
confirmNewEmail({key}) {
return request.post(
'/api/accounts/change-email/confirm-new-email',
{key}
);
}
};