Skip to content

Commit b6f1cf6

Browse files
committed
Update getGist.ts
1 parent af3f006 commit b6f1cf6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/getGist.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
import request from './structures/request';
2-
import { GistResponse } from './types';
2+
import { GistResponse, ReqRet } from './types';
33

4-
export default async (id: string, token: string): Promise<GistResponse> => {
4+
export default async (
5+
id: string,
6+
token: string
7+
): Promise<ReqRet<GistResponse>> => {
58
return await request<GistResponse>(
69
`https://api.github.com/gists/${id}`,
710
token,
811
'GET',
912
{}
1013
)
1114
.then((response) => {
12-
return Promise.resolve(response);
15+
return Promise.resolve({
16+
data: response.data,
17+
status: response.status,
18+
});
1319
})
1420
.catch((err) => {
1521
return Promise.reject(err);

0 commit comments

Comments
 (0)