Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support includes_description in listStories #94

Merged
merged 2 commits into from
Mar 1, 2021

Conversation

charpeni
Copy link
Member

@charpeni charpeni commented Mar 1, 2021

Resolves #80.

List Stories is returning an array of StorySlim and by default, the description field isn't included. We can support this by passing includes_description as an argument.

Copy link
Member

@iwillig iwillig left a comment

Choose a reason for hiding this comment

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

Looks good, just a couple of minor questions. Nothing blocking. 👍🏻

src/index.ts Outdated
return this.listResource(`projects/${projectID}/stories`);
listStories(
projectID: ID,
includesDescription: boolean,
Copy link
Member

Choose a reason for hiding this comment

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

Is this an optional parameter?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, nice catch!

This is working fine as includesDescription will be undefined and converted as a boolean below, but let's make it explicit to avoid confusion here.

.then(this.responseParser.parseResponse);
listResource<T>(
uri: string,
params?: Record<string, any> | null | undefined,
Copy link
Member

Choose a reason for hiding this comment

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

Record means anything Map like?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, sort of. Record<Keys, Type> is an elegant way of typing objects.

@charpeni charpeni merged commit 988c498 into main Mar 1, 2021
@charpeni charpeni deleted the listStories-includes-description branch March 1, 2021 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

listStories does not include the description field.
2 participants