change user details and password
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Link from "next/link";
|
||||
import _ from "lodash";
|
||||
import React, { useState } from "react";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { useRouter } from "next/router";
|
||||
import useTranslation from "next-translate/useTranslation";
|
||||
import {
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
getFormSubmitErrors,
|
||||
} from "redux-form";
|
||||
import { useDispatch, useSelector, shallowEqual, connect } from "react-redux";
|
||||
import { updatePassword } from "../../actions";
|
||||
|
||||
const RenderTextfield = ({
|
||||
id,
|
||||
@@ -75,6 +76,10 @@ const ChangePassword = (props) => {
|
||||
let errorsobj = {};
|
||||
|
||||
const onHandleSubmit = (values) => {
|
||||
let contactid = props.props.accountDetails.loggedinUserId;
|
||||
let updateBody = props.props.form.changepasswordForm.values.newpassword;
|
||||
console.log(contactid, updateBody);
|
||||
updatePassword(contactid, updateBody);
|
||||
setPasswordUpdated(true);
|
||||
};
|
||||
|
||||
@@ -123,12 +128,25 @@ const ChangePassword = (props) => {
|
||||
>
|
||||
Continue
|
||||
</button>
|
||||
<Link
|
||||
href={
|
||||
"/myportal?q=" +
|
||||
props.accountDetails.loggedinUserId
|
||||
}
|
||||
>
|
||||
<a className="govuk-link">Cancel</a>
|
||||
</Link>
|
||||
</div>
|
||||
</form>
|
||||
) : (
|
||||
<>
|
||||
<p className="govuk-body">
|
||||
<Link href="/myportal">
|
||||
<Link
|
||||
href={
|
||||
"/myportal?q=" +
|
||||
props.accountDetails.loggedinUserId
|
||||
}
|
||||
>
|
||||
<a className="govuk-link">Go to My Portal</a>
|
||||
</Link>
|
||||
</p>
|
||||
@@ -144,6 +162,7 @@ const mapStateToProps = (state) => {
|
||||
searchResultsObj: state.searchResultsObj,
|
||||
formData: state.formData,
|
||||
appealType: state.appealType,
|
||||
accountDetails: state.accountDetails,
|
||||
//form: state.form,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user