()
| 105 | }); |
| 106 | |
| 107 | async function fetchIssueData(): Promise<Record<string, any>> { |
| 108 | const {owner, name} = getRepo()!; |
| 109 | const body = { |
| 110 | // `IssueViewerSecondaryViewQuery` |
| 111 | query: 'cb9b35846fadf5f80ec3a2c05bf42a89', |
| 112 | variables: {number: getConversationNumber()!, owner, repo: name}, |
| 113 | }; |
| 114 | const url = new URL('/_graphql', location.origin); |
| 115 | url.searchParams.set('body', JSON.stringify(body)); |
| 116 | |
| 117 | const response = await fetch(url, {headers: githubApiBaseHeaders}); |
| 118 | if (!response.ok) { |
| 119 | throw new Error('Failed to fetch the issue'); |
| 120 | } |
| 121 | |
| 122 | const {data} = await response.json(); |
| 123 | return data; |
| 124 | } |
| 125 | |
| 126 | async function updateSubscription(targetStatus: SubscriptionStatus, id: string): Promise<void> { |
| 127 | const response = await fetch('/_graphql', { |
no test coverage detected