Skip to content

feat(Query for Author): If passed Author id query Author API#78

Merged
chchitti merged 2 commits intomasterfrom
load-author-stories
Apr 10, 2019
Merged

feat(Query for Author): If passed Author id query Author API#78
chchitti merged 2 commits intomasterfrom
load-author-stories

Conversation

@chchitti
Copy link
Contributor

@chchitti chchitti commented Apr 5, 2019

This is needed because we need author stories for vikatan. The urls format is /api/v1/authors/<author_id>/collection.

So I have made a provision to accept a type of collection and collection id and stories will be returned based on these inputs.

@chchitti chchitti requested a review from sinujohn91 April 5, 2019 06:23
const collectionId = get(this.props, ["collectionId"],null);

const url = (collectionType && collectionId) ?
`/api/v1/${collectionType}/${collectionId}/collection`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this /api/v1/authors/<author_id>/collection a collection api?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use api prop in LoadMoreStoriesBase for it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a collection api.

const collectionId = get(this.props, ["collectionId"],null);

const url = (collectionType && collectionId) ?
`/api/v1/${collectionType}/${collectionId}/collection`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not collectionId, its authorId. I guess passing authorId and checking that, instead of passing collectionType should suffice.

@sinujohn91
Copy link
Contributor

please update the readme as well

@chchitti chchitti changed the title Accomodate url for <collection-type> and collection id feat(Accomodate url for <collection-type> and collection id) Apr 10, 2019
@chchitti chchitti changed the title feat(Accomodate url for <collection-type> and collection id) feat(Query for Author): If passed Author id query Author API Apr 10, 2019
@chchitti chchitti merged commit dd55c06 into master Apr 10, 2019
@delete-merged-branch delete-merged-branch bot deleted the load-author-stories branch April 10, 2019 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants