Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jshawl committed Jan 25, 2024
1 parent d939464 commit ba3a61f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/hosted-buttons/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,8 @@ export const buildHostedButtonCreateOrder = ({
...userInputs,
}),
})
.then(({ body }) => {
if (!body.context_id) {
onError(body.name);
}
return body.context_id;
})
.catch(() => {
onError("REQUEST_FAILED");
});
.then(({ body }) => body.context_id || onError(body.name))
.catch(() => onError("REQUEST_FAILED"));
});
};
};
Expand Down

0 comments on commit ba3a61f

Please sign in to comment.