Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getAccountBill() {
- const accountBill = `2222${Math.floor(
- Math.random() * 90000000000000000000,
- ) + 10000000000000000000}`;
- Bill.findOne({
- where: {
- account_bill: accountBill,
- },
- })
- .then(isAccountBill => {
- if (!isAccountBill) {
- getAccountBill();
- }
- return accountBill;
- })
- .catch(err => {
- /* just ignore */
- });
- }
Add Comment
Please, Sign In to add comment