R
Reactiflux

help-js

✅ – ✅ – dmikester1 – 21-49 May 1

Ddmikester15/1/2023
Can anyone see why this function is returning immediately with result being undefined?
const handlePartialSubmit = async (e) => {
e.preventDefault();
const result = await updatePalletCountAsync(
lineNum,
false,
lastPalletBagCount === '' ? 0 : lastPalletBagCount
);
console.log({ res2: result });
...
const handlePartialSubmit = async (e) => {
e.preventDefault();
const result = await updatePalletCountAsync(
lineNum,
false,
lastPalletBagCount === '' ? 0 : lastPalletBagCount
);
console.log({ res2: result });
...
And here is updatePalletCountAsync:
Ddmikester15/1/2023
SScriptyChris5/1/2023
Can you share it on pastebin or something similar?
Ddmikester15/2/2023
Here is the gist. Let me know if you need any other code. Thanks! https://gist.github.com/dmikester1/b4429ec0ff86105a0e0e7b1d562ad4f9 do I need to promisify that second function? OK, so yes, I did indeed need to promisify that second function!
const updatePalletCountAsync = async (
lineNum,
subtract = false,
partial = 0
) => {
return new Promise(async (resolve, reject) => {
...
const updatePalletCountAsync = async (
lineNum,
subtract = false,
partial = 0
) => {
return new Promise(async (resolve, reject) => {
...
UUUnknown User5/3/2023
4 Messages Not Public
Sign In & Join Server To View

Looking for more? Join the community!