diff options
Diffstat (limited to 'vnext/src/components/Contacts.js')
-rw-r--r-- | vnext/src/components/Contacts.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/vnext/src/components/Contacts.js b/vnext/src/components/Contacts.js index 300e60eb..aea537d4 100644 --- a/vnext/src/components/Contacts.js +++ b/vnext/src/components/Contacts.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Link } from 'react-router-dom'; +import { getChats } from '../api'; import Contact from './Contact.js'; @@ -16,12 +16,11 @@ export default class Contacts extends React.Component { } refreshChats() { - fetch(`https://api.juick.com/groups_pms?hash=${this.props.visitor.hash}`) - .then(response => response.json()) - .then(jsonResponse => { + getChats() + .then(response => { this.setState({ isLoading: false, - pms: jsonResponse.pms + pms: response.data.pms }); }); } |