mirror of
https://github.com/joelwmale/webhook-action.git
synced 2026-08-24 00:49:00 +08:00
Attempt to have code wait for request to finish
This commit is contained in:
+3
-2
@@ -2,8 +2,9 @@ const fetch = require('node-fetch');
|
||||
|
||||
class Http {
|
||||
make(url: string, headers: string, body: string): Promise<any> {
|
||||
return new Promise(() => {
|
||||
fetch(url, this.getOptions('post', headers, body));
|
||||
return new Promise((resolve, reject) => {
|
||||
fetch(url, this.getOptions('post', headers, body))
|
||||
.then((res: Response) => resolve(res));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user