~romuloalves/get-instagram-feed

72bfe2905ec83ec7e479b55c07773b1606062f81 — romuloalves 1 year, 6 months ago a2f873c
Renames functions
2 files changed, 4 insertions(+), 4 deletions(-)

R src/{get-picture.ts => get.ts}
M src/index.ts
R src/get-picture.ts => src/get.ts +2 -2
@@ 1,6 1,6 @@
import getInstagramData from '@romuloalves/get-instagram-data';

const getImages = (data: any): Array<Object> => {
const parse = (data: any): Array<Object> => {
  if (data == null || data.entry_data == null ||
    data.entry_data.ProfilePage == null || data.entry_data.ProfilePage.length === 0) {
    return [];


@@ 38,5 38,5 @@ const getImages = (data: any): Array<Object> => {
export default async user => {
  const data = await getInstagramData(user);

  return getImages(data);
  return parse(data);
};

M src/index.ts => src/index.ts +2 -2
@@ 1,10 1,10 @@
import { NowRequest, NowResponse } from '@now/node';

import getPicture from './get-picture';
import getData from './get';

export default async function(request: NowRequest, response: NowResponse) {
  const { id: userId } = request.query;
  const data = await getPicture(userId);
  const data = await getData(userId);

  return response.status(200).json(data);
};