We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a272385 commit 6beef45Copy full SHA for 6beef45
src/gist/update.ts
@@ -0,0 +1,25 @@
1
+import request from '../structures/request';
2
+import { GistFile, GistOptions, ReqRet } from '../types';
3
+
4
+export default async (
5
+ id: string,
6
+ files: GistFile,
7
+ description: string,
8
+ token: string,
9
+ options?: GistOptions
10
+): Promise<ReqRet<{}>> =>
11
+ await request<{}>(`https://api.github.com/gists/${id}`, token, 'PATCH', {
12
+ data: {
13
+ description: description,
14
+ files: {
15
+ ...files,
16
+ },
17
+ public: options?.secret ? true : false,
18
19
+ })
20
+ .then((response) =>
21
+ Promise.resolve({
22
+ status: response.status,
23
24
+ )
25
+ .catch((err) => Promise.reject(err));
0 commit comments