Function
getStatusId
({
accessToken,
status,
}: {
accessToken: string;
status: 'started' | 'completed';
})
Source from the content-addressed store, hash-verified
| 114 | } |
| 115 | |
| 116 | export async function getStatusId({ |
| 117 | accessToken, |
| 118 | status, |
| 119 | }: { |
| 120 | accessToken: string; |
| 121 | status: 'started' | 'completed'; |
| 122 | }) { |
| 123 | const linearClient = new LinearClient({ accessToken }); |
| 124 | |
| 125 | const states = await linearClient |
| 126 | .workflowStates({ |
| 127 | includeArchived: false, |
| 128 | filter: { type: { eq: status } }, |
| 129 | first: 1, |
| 130 | }) |
| 131 | .then((r) => r?.nodes?.shift()); |
| 132 | |
| 133 | return states?.id; |
| 134 | } |
Tested by
no test coverage detected