mirror of
https://github.com/joelwmale/webhook-action.git
synced 2024-11-25 08:56:57 +01:00
Attempt to have code wait for request to finish
This commit is contained in:
parent
cfebc00721
commit
db36b9f178
9 changed files with 11 additions and 8 deletions
5
dist/http.js
vendored
5
dist/http.js
vendored
|
@ -7,8 +7,9 @@ var Http = (function () {
|
|||
}
|
||||
Http.prototype.make = function (url, headers, body) {
|
||||
var _this = this;
|
||||
return new Promise(function () {
|
||||
fetch(url, _this.getOptions('post', headers, body));
|
||||
return new Promise(function (resolve, reject) {
|
||||
fetch(url, _this.getOptions('post', headers, body))
|
||||
.then(function (res) { return resolve(res); });
|
||||
});
|
||||
};
|
||||
Http.prototype.getOptions = function (method, headers, body) {
|
||||
|
|
2
dist/http.js.map
vendored
2
dist/http.js.map
vendored
|
@ -1 +1 @@
|
|||
{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":";;;AAAA,IAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAEpC;IAAA;IAqBA,CAAC;IApBC,mBAAI,GAAJ,UAAK,GAAW,EAAE,OAAe,EAAE,IAAY;QAA/C,iBAIC;QAHC,OAAO,IAAI,OAAO,CAAC;YACjB,KAAK,CAAC,GAAG,EAAE,KAAI,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,yBAAU,GAAV,UAAW,MAAc,EAAE,OAAe,EAAE,IAAY;QACtD,IAAM,OAAO,GAAQ;YACnB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YAC5B,MAAM,QAAA;SACP,CAAC;QAGF,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAGpC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAC;QAErD,OAAO,OAAO,CAAC;IACjB,CAAC;IACH,WAAC;AAAD,CAAC,AArBD,IAqBC;AAEY,QAAA,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC"}
|
||||
{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":";;;AAAA,IAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAEpC;IAAA;IAsBA,CAAC;IArBC,mBAAI,GAAJ,UAAK,GAAW,EAAE,OAAe,EAAE,IAAY;QAA/C,iBAKC;QAJC,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;YACjC,KAAK,CAAC,GAAG,EAAE,KAAI,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;iBAC/C,IAAI,CAAC,UAAC,GAAa,IAAK,OAAA,OAAO,CAAC,GAAG,CAAC,EAAZ,CAAY,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,yBAAU,GAAV,UAAW,MAAc,EAAE,OAAe,EAAE,IAAY;QACtD,IAAM,OAAO,GAAQ;YACnB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YAC5B,MAAM,QAAA;SACP,CAAC;QAGF,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAGpC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAC;QAErD,OAAO,OAAO,CAAC;IACjB,CAAC;IACH,WAAC;AAAD,CAAC,AAtBD,IAsBC;AAEY,QAAA,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC"}
|
5
dist/index.js
vendored
5
dist/index.js
vendored
|
@ -305,8 +305,9 @@ var Http = (function () {
|
|||
}
|
||||
Http.prototype.make = function (url, headers, body) {
|
||||
var _this = this;
|
||||
return new Promise(function () {
|
||||
fetch(url, _this.getOptions('post', headers, body));
|
||||
return new Promise(function (resolve, reject) {
|
||||
fetch(url, _this.getOptions('post', headers, body))
|
||||
.then(function (res) { return resolve(res); });
|
||||
});
|
||||
};
|
||||
Http.prototype.getOptions = function (method, headers, body) {
|
||||
|
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
BIN
node_modules/@vercel/ncc/dist/ncc/cli.js.cache
generated
vendored
BIN
node_modules/@vercel/ncc/dist/ncc/cli.js.cache
generated
vendored
Binary file not shown.
BIN
node_modules/@vercel/ncc/dist/ncc/index.js.cache
generated
vendored
BIN
node_modules/@vercel/ncc/dist/ncc/index.js.cache
generated
vendored
Binary file not shown.
BIN
node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache
generated
vendored
BIN
node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache
generated
vendored
Binary file not shown.
BIN
node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache
generated
vendored
BIN
node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache
generated
vendored
Binary file not shown.
|
@ -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));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue