aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/Contacts.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-06-27 14:33:34 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:53 +0300
commit40b8cd9853dd87deb90afdda0f5af78faa414f2b (patch)
treef4beb12efd422f178cfe168367ef91b17f6131b8 /vnext/src/components/Contacts.js
parent8307e220c4fdddbc0a9740ad4b43fc2e205864bd (diff)
fetch -> axios
Diffstat (limited to 'vnext/src/components/Contacts.js')
-rw-r--r--vnext/src/components/Contacts.js9
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
});
});
}