From 40b8cd9853dd87deb90afdda0f5af78faa414f2b Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 27 Jun 2018 14:33:34 +0300 Subject: fetch -> axios --- vnext/src/components/Contacts.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'vnext/src/components/Contacts.js') 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 }); }); } -- cgit v1.2.3