From dffea482998bd9d3662997c43082cd7533758857 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Tue, 14 Jun 2016 17:33:54 -0400 Subject: [PATCH] Fixup api refactor Updates after a rebase --- src/views/explore/explore.jsx | 7 ++----- src/views/search/search.jsx | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/views/explore/explore.jsx b/src/views/explore/explore.jsx index 507f61759..0b1cd7d69 100644 --- a/src/views/explore/explore.jsx +++ b/src/views/explore/explore.jsx @@ -3,7 +3,7 @@ var FormattedMessage = require('react-intl').FormattedMessage; var React = require('react'); var render = require('../../lib/render.jsx'); -var Api = require('../../mixins/api.jsx'); +var api = require('../../lib/api'); var Page = require('../../components/page/www/page.jsx'); var Box = require('../../components/box/box.jsx'); @@ -16,9 +16,6 @@ require('./explore.scss'); // @todo migrate to React-Router once available var Explore = injectIntl(React.createClass({ type: 'Explore', - mixins: [ - Api - ], getDefaultProps: function () { var categoryOptions = ['all','animations','art','games','music','stories']; var typeOptions = ['projects','studios']; @@ -57,7 +54,7 @@ var Explore = injectIntl(React.createClass({ if (this.props.tab != 'all') { qText = '&q=' + this.props.category; } - this.api({ + api({ uri: '/search/' + this.props.itemType + '?limit=' + this.props.loadNumber + '&offset=' + this.state.offset + diff --git a/src/views/search/search.jsx b/src/views/search/search.jsx index 17a0983ac..ecd6cff29 100644 --- a/src/views/search/search.jsx +++ b/src/views/search/search.jsx @@ -3,7 +3,7 @@ var FormattedMessage = require('react-intl').FormattedMessage; var React = require('react'); var render = require('../../lib/render.jsx'); -var Api = require('../../mixins/api.jsx'); +var api = require('../../lib/api'); var Page = require('../../components/page/www/page.jsx'); var Box = require('../../components/box/box.jsx'); @@ -16,9 +16,6 @@ require('./search.scss'); // @todo migrate to React-Router once available var Search = injectIntl(React.createClass({ type: 'Search', - mixins: [ - Api - ], getDefaultProps: function () { var query = window.location.search; var pathname = window.location.pathname.toLowerCase(); @@ -60,7 +57,7 @@ var Search = injectIntl(React.createClass({ if (this.props.searchTerm !== '') { termText = '&q=' + this.props.searchTerm; } - this.api({ + api({ uri: '/search/' + this.props.tab + '?limit=' + this.props.loadNumber + '&offset=' + this.state.offset +