Skip to content

Commit eaa131f

Browse files
committed
Update createGist.ts
1 parent 300a596 commit eaa131f

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

src/createGist.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,20 @@ export default async (
77
token: string,
88
options?: GistOptions
99
): Promise<GistResponse> => {
10-
return await request<GistResponse>("https://api.github.com/gists", {
11-
method: "POST",
12-
headers: {
13-
"content-type": "application/json",
14-
accept: "application/vnd.github.v3+json",
15-
Authorization: `Bearer ${token}`,
16-
},
17-
data: {
18-
description: description,
19-
files: {
20-
...files,
10+
return await request<GistResponse>(
11+
"https://api.github.com/gists",
12+
token,
13+
"POST",
14+
{
15+
data: {
16+
description: description,
17+
files: {
18+
...files,
19+
},
20+
public: options?.secret ? false : true,
2121
},
22-
public: options?.secret ? false : true,
23-
},
24-
})
22+
}
23+
)
2524
.then((response) => {
2625
return Promise.resolve(response);
2726
})

0 commit comments

Comments
 (0)