0
0
Fork 0

Refactor /api/web APIs to use the centralized axios instance (#6223)

Also adds the ability to decouple the centralized axios logic from the
state dispatcher
This commit is contained in:
nightpool 2018-01-08 14:01:33 -05:00 committed by Eugen Rochko
parent ff6ca8bdc6
commit c235711ffe
5 changed files with 21 additions and 13 deletions

View file

@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { FormattedMessage, injectIntl } from 'react-intl';
import axios from 'axios';
import api from '../../../api';
@injectIntl
export default class EmbedModal extends ImmutablePureComponent {
@ -23,7 +23,7 @@ export default class EmbedModal extends ImmutablePureComponent {
this.setState({ loading: true });
axios.post('/api/web/embed', { url }).then(res => {
api().post('/api/web/embed', { url }).then(res => {
this.setState({ loading: false, oembed: res.data });
const iframeDocument = this.iframe.contentWindow.document;