-
Notifications
You must be signed in to change notification settings - Fork 0
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
4.1.0 #276
4.1.0 #276
Changes from 11 commits
2988469
ea91e98
62d18b5
888eb12
9983449
7996962
762ebfc
2227340
9f1e9f5
3a12e0e
c3d2756
6a94727
3cff7e3
16fae7e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,13 +3,14 @@ | |||||
import CustomFieldsService from '@sx/custom-fields/custom-fields-service' | ||||||
import StoryInterface from '@sx/stories/contracts/story-interface' | ||||||
import StoryCustomFieldInterface from '@sx/stories/custom-fields/contracts/story-custom-field-interface' | ||||||
import {getHeaders} from '@sx/utils/headers' | ||||||
Check failure on line 6 in src/stories/custom-fields/story-custom-field.ts GitHub Actions / lint
Check failure on line 6 in src/stories/custom-fields/story-custom-field.ts GitHub Actions / lint
|
||||||
import UUID from '@sx/utils/uuid' | ||||||
|
||||||
|
||||||
export default class StoryCustomField extends BaseResource<StoryInterface> implements StoryCustomFieldInterface { | ||||||
public baseUrl = 'https://api.app.shortcut.com/api/v3/stories' | ||||||
public availableOperations = [] | ||||||
private customField: CustomField | null = null | ||||||
|
||||||
constructor(init: StoryCustomFieldInterface) { | ||||||
super() | ||||||
|
@@ -23,8 +24,20 @@ | |||||
* without making a separate request. | ||||||
*/ | ||||||
get field(): Promise<CustomField> { | ||||||
const service = new CustomFieldsService({headers: getHeaders()}) | ||||||
return service.get(this.fieldId) | ||||||
if (this.customField) { | ||||||
return Promise.resolve(this.customField) | ||||||
} | ||||||
const service: CustomFieldsService = new CustomFieldsService({headers: getHeaders()}) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <@stylistic/object-curly-spacing> reported by reviewdog 🐶
Suggested change
|
||||||
const field: Promise<CustomField> = service.get(this.fieldId) | ||||||
field.then((field: CustomField) => this.customField = field) | ||||||
return field | ||||||
} | ||||||
|
||||||
/** | ||||||
* Get the name of the custom field that this story custom field is associated with. | ||||||
*/ | ||||||
get name(): Promise<string> { | ||||||
return this.field.then((field) => field.name) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [eslint] <@stylistic/arrow-parens> reported by reviewdog 🐶
Suggested change
|
||||||
} | ||||||
|
||||||
fieldId: UUID | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <@stylistic/object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.