Compare commits
1 Commits
make-error
...
add-contac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b329b4eeb6 |
@@ -143,7 +143,7 @@ const Address = (props) => {
|
|||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
const Main = ({ user, onAddressAdded, onAddressRemoved, readOnly }) => {
|
const Main = ({ user, onAddressAdded, onAddressRemoved, onContactAdded, readOnly }) => {
|
||||||
return (
|
return (
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="col-xl-12">
|
<div className="col-xl-12">
|
||||||
@@ -158,7 +158,7 @@ const Main = ({ user, onAddressAdded, onAddressRemoved, readOnly }) => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-xl-6">
|
<div className="col-xl-6">
|
||||||
<ContactInfo user={user} readOnly={readOnly} />
|
<ContactInfo user={user} readOnly={readOnly} onContactAdded={onContactAdded} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -685,6 +685,7 @@ const ContactInfo = (props) => {
|
|||||||
title={"Member Contact"}
|
title={"Member Contact"}
|
||||||
buttonValue={"Add Contact"}
|
buttonValue={"Add Contact"}
|
||||||
showDescription={false}
|
showDescription={false}
|
||||||
|
onNewContact={props.onContactAdded}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -823,6 +824,7 @@ class User extends React.Component {
|
|||||||
this.getUser = this.getUser.bind(this);
|
this.getUser = this.getUser.bind(this);
|
||||||
this.handleAddressAdded = this.handleAddressAdded.bind(this);
|
this.handleAddressAdded = this.handleAddressAdded.bind(this);
|
||||||
this.handleAddressRemoved = this.handleAddressRemoved.bind(this);
|
this.handleAddressRemoved = this.handleAddressRemoved.bind(this);
|
||||||
|
this.handleContactAdded = this.handleContactAdded.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@@ -840,6 +842,22 @@ class User extends React.Component {
|
|||||||
.catch(console.error);
|
.catch(console.error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleContactAdded(contact) {
|
||||||
|
const user_uuid = this.props.params.user_uuid;
|
||||||
|
const self = this;
|
||||||
|
|
||||||
|
var contactObj = {
|
||||||
|
"type": contact.type,
|
||||||
|
"contact": contact.contact,
|
||||||
|
}
|
||||||
|
|
||||||
|
Instance.getRawConn().post(`/v1/nemt/users/portal/${user_uuid}/contact`, contactObj)
|
||||||
|
.then(res => {
|
||||||
|
this.getUser(user_uuid);
|
||||||
|
})
|
||||||
|
.catch(console.error);
|
||||||
|
}
|
||||||
|
|
||||||
handleAddressAdded(address) {
|
handleAddressAdded(address) {
|
||||||
const user_uuid = this.props.params.user_uuid;
|
const user_uuid = this.props.params.user_uuid;
|
||||||
const self = this;
|
const self = this;
|
||||||
@@ -890,6 +908,7 @@ class User extends React.Component {
|
|||||||
user={user}
|
user={user}
|
||||||
onAddressAdded={this.handleAddressAdded}
|
onAddressAdded={this.handleAddressAdded}
|
||||||
onAddressRemoved={this.handleAddressRemoved}
|
onAddressRemoved={this.handleAddressRemoved}
|
||||||
|
onContactAdded={this.handleContactAdded}
|
||||||
readOnly={readOnly}
|
readOnly={readOnly}
|
||||||
/>
|
/>
|
||||||
</QueueAnim>
|
</QueueAnim>
|
||||||
|
|||||||
Reference in New Issue
Block a user