Skip to content

Commit

Permalink
adjust returned type
Browse files Browse the repository at this point in the history
  • Loading branch information
drawrowfly committed Jun 21, 2021
1 parent 0315f05 commit 99c9f27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/core/InstaTouch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
ScrapeType,
Edges,
GraphQl,
UserStories,
} from '../types';

export class InstaTouch {
Expand Down Expand Up @@ -637,7 +638,7 @@ export class InstaTouch {
return response;
}

public async getStories(id: string): Promise<PostMetaFromWebApi> {
public async getStories(id: string): Promise<UserStories> {
const options = {
method: 'GET',
uri: `https://i.instagram.com/api/v1/feed/reels_media/?reel_ids=${id}`,
Expand All @@ -648,7 +649,7 @@ export class InstaTouch {
json: true,
};

const response = await this.request<PostMetaFromWebApi>(options);
const response = await this.request<UserStories>(options);
return response;
}

Expand Down
4 changes: 2 additions & 2 deletions src/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { readFile, writeFile, unlink } from 'fs';
import { fromCallback } from 'bluebird';
import { forEachLimit } from 'async';
import { InstaTouch } from './core';
import { Constructor, ScrapeType, Options, Result, UserMetaFromWebApi, PostMetaFromWebApi, History, HistoryItem } from './types';
import { Constructor, ScrapeType, Options, Result, UserMetaFromWebApi, PostMetaFromWebApi, History, HistoryItem, UserStories } from './types';
import CONST from './constant';

const INIT_OPTIONS = {
Expand Down Expand Up @@ -152,7 +152,7 @@ export const getPostMeta = async (input: string, options?: Options): Promise<Pos
return result;
};

export const getStories = async (input: string, options?: Options): Promise<PostMetaFromWebApi> => {
export const getStories = async (input: string, options?: Options): Promise<UserStories> => {
if (options && typeof options !== 'object') {
throw new TypeError('Object is expected');
}
Expand Down

0 comments on commit 99c9f27

Please sign in to comment.