Updated trends, shop api request routes

• Updated:
- trends, shop api request routes
This commit is contained in:
mgabdev 2020-07-08 19:36:50 -05:00
parent 7548b1ea47
commit 2f1673a886
2 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import api from '../api'
import axios from 'axios'
export const GAB_TRENDS_RESULTS_FETCH_REQUEST = 'GAB_TRENDS_RESULTS_FETCH_REQUEST'
export const GAB_TRENDS_RESULTS_FETCH_SUCCESS = 'GAB_TRENDS_RESULTS_FETCH_SUCCESS'
@ -8,7 +8,9 @@ export const fetchGabTrends = (feedType) => {
return function (dispatch, getState) {
dispatch(fetchGabTrendsRequest(feedType))
api(getState).get(`/api/v1/gab_trends?type=${feedType}`).then((response) => {
const url = feedType === 'partner' ? 'https://trends.gab.com/partner' : 'https://trends.gab.com/trend-feed/json'
axios.get(url).then((response) => {
dispatch(fetchGabTrendsSuccess(response.data, feedType))
}).catch(function (error) {
dispatch(fetchGabTrendsFail(error, feedType))

View File

@ -1,4 +1,4 @@
import api from '../api'
import axios from 'axios'
import { me } from '../initial_state'
export const SHOP_FEATURED_PRODUCTS_FETCH_REQUEST = 'SHOP_FEATURED_PRODUCTS_FETCH_REQUEST'
@ -11,7 +11,7 @@ export const fetchFeaturedProducts = () => {
dispatch(fetchFeaturedProductsRequest('featured'))
api(getState).get(`/api/v1/shop?type=featured_products`).then((response) => {
axios.get('https://shop.dissenter.com/product/group/json').then((response) => {
try {
dispatch(fetchFeaturedProductsSuccess(response.data.data, 'featured'))
} catch (error) {