()
| 187 | } |
| 188 | |
| 189 | export function loadUser(): Promise<User | null> { |
| 190 | if (token.value === null) { |
| 191 | return Promise.resolve(null); |
| 192 | } |
| 193 | return githubFetch(githubRequest('user')) |
| 194 | .then(response => { |
| 195 | if (response.ok) { |
| 196 | return response.json(); |
| 197 | } |
| 198 | return null; |
| 199 | }); |
| 200 | } |
| 201 | |
| 202 | export function createIssue(issueTerm: string, documentUrl: string, title: string, description: string, label: string) { |
| 203 | const url = `${UTTERANCES_API}/repos/${owner}/${repo}/issues${label ? `?label=${encodeURIComponent(label)}` : ''}`; |
no test coverage detected