Skip to content

Commit

Permalink
wait for promise to finish when processing params (#1702)
Browse files Browse the repository at this point in the history
  • Loading branch information
deniak authored Feb 10, 2023
1 parent bb30375 commit ca1a8f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ const processRequest = apiKey => async (req, res) => {
(...data) => {
errors.push(Object.assign({}, ...data));
},
data => {
async data => {
if (errors.length > 0)
sendJSONresult(errors, [], [], res, {});
else {
const meta = data.metadata;
if (options.url) meta.url = options.url;
else meta.file = options.file;
try {
options2 = processParams(meta, undefined, {
options2 = await processParams(meta, undefined, {
allowUnknownParams: true,
});
} catch (err) {
Expand Down

0 comments on commit ca1a8f5

Please sign in to comment.