(
payload:
| GitHubTypes.IssuesReopenedEvent
| GitHubTypes.IssuesClosedEvent
| GitHubTypes.IssuesOpenedEvent
)
| 74 | |
| 75 | // reusable between webhooks issue related |
| 76 | async function handleIssue( |
| 77 | payload: |
| 78 | | GitHubTypes.IssuesReopenedEvent |
| 79 | | GitHubTypes.IssuesClosedEvent |
| 80 | | GitHubTypes.IssuesOpenedEvent |
| 81 | ) { |
| 82 | const { channel, externalThreadId } = await handleCommon(payload); |
| 83 | const user = await handleUser(payload.issue.user, channel); |
| 84 | |
| 85 | const thread = Serializer.githubIssueToLinenThread( |
| 86 | payload.issue, |
| 87 | user.id, |
| 88 | channel.id, |
| 89 | channel.accountId, |
| 90 | externalThreadId |
| 91 | ); |
| 92 | return thread; |
| 93 | } |
| 94 | |
| 95 | // reusable: helper to identify channel and build thread external id |
| 96 | async function handleCommon( |
no test coverage detected