diff options
author | 2020-11-18 19:55:59 -0500 | |
---|---|---|
committer | 2020-11-18 18:55:59 -0600 | |
commit | a935456acab0c7bdc021829e18ce20230e18c752 (patch) | |
tree | e61eed13a433381ba223a4ca962e904c8740fc91 /source/github-helpers/api.ts | |
parent | cab33f6f47c4eef0a3bc793f2004767f34b6abe9 (diff) | |
download | refined-github-a7e8057d2e873d04e02d03e393b5ff604298d6b2.tar.gz refined-github-a7e8057d2e873d04e02d03e393b5ff604298d6b2.tar.zst refined-github-a7e8057d2e873d04e02d03e393b5ff604298d6b2.zip |
Lint (#3723)20.11.19
Diffstat (limited to 'source/github-helpers/api.ts')
-rw-r--r-- | source/github-helpers/api.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/github-helpers/api.ts b/source/github-helpers/api.ts index 268d16d2..98b2ddf9 100644 --- a/source/github-helpers/api.ts +++ b/source/github-helpers/api.ts @@ -29,8 +29,8 @@ import mem from 'mem'; import * as pageDetect from 'github-url-detection'; import {JsonObject, AsyncReturnType} from 'type-fest'; -import optionsStorage from '../options-storage'; import {getRepo} from '.'; +import optionsStorage from '../options-storage'; interface JsonError { message: string; @@ -161,6 +161,8 @@ export const v4 = mem(async ( throw new TypeError('`query` should only be what’s inside \'query {...}\', like \'user(login: "foo") { name }\', but is \n' + query); } + query = query.replace('repository() {', () => `repository(owner: "${getRepo()!.owner}", name: "${getRepo()!.name}") {`); + const response = await fetch(api4, { headers: { 'User-Agent': 'Refined GitHub', |