Skip to content

Commit e445f4c

Browse files
committed
Create getGist.ts
1 parent fc3c8cb commit e445f4c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/getGist.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import request from "./structures/request";
2+
import { GistResponse } from "./types";
3+
4+
export default async (id: string, token: string): Promise<GistResponse> => {
5+
return await request<GistResponse>(
6+
`https://api.github.com/gists/${id}`,
7+
token,
8+
"GET",
9+
{}
10+
)
11+
.then((response) => {
12+
return Promise.resolve(response);
13+
})
14+
.catch((err) => {
15+
return Promise.reject(err);
16+
});
17+
};

0 commit comments

Comments
 (0)