Add basic Formik setup and example for update password
This commit is contained in:
parent
403a1e79fa
commit
d43b7ea5bc
7 changed files with 275 additions and 40 deletions
21
resources/scripts/api/account/updateAccountPassword.ts
Normal file
21
resources/scripts/api/account/updateAccountPassword.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import http from '@/api/http';
|
||||
|
||||
interface Data {
|
||||
current: string;
|
||||
password: string;
|
||||
confirmPassword: string;
|
||||
}
|
||||
|
||||
export default ({ current, password, confirmPassword }: Data): Promise<void> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
http.put('/account/password', {
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
current_password: current,
|
||||
password: password,
|
||||
// eslint-disable-next-line @typescript-eslint/camelcase
|
||||
password_confirmation: confirmPassword,
|
||||
})
|
||||
.then(() => resolve())
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue