Members
# deleteBarcode
This function is used to delete selected barcode or min and after deleting push data to indexeddb. updateScannedData callback function checks deleted min/barcode has another entry in list, if entry is present then need to update valid flag as well as deleted return id. If localstorage is empty then it removes whole item.
# submitBarcodes
This function check value stored is min or barcode from indexeddb. if its barcode and has validFlag=true then it sends data with returnId as {barcode:12344535,returnId:6576} and That barcode's validFlag is false then send data as {barcode:5645646454} Same applies in case of minId too. JSON object looks like [{min:909845, returnId:6768},{barcode:464757757578,returnId:6767},{min:909844},{barcode:464757757577}] and then call post API. It also checks App has internet connection or not, If internet connection is not there then It sends API call when internet is back
Methods
# barcodeSendSuccess()
This function checks if any error while sending barcode to API then it redirects to error page. If barcodes successfully submitted then redirects it to success page.
# componentDidUpdate()
ComponentDidUpdate gets data from indexeddb and sets to State, If data's validFlag is true means its valid product(From returns table) , If validFlag is false then that data is not from products returned from list.
# deleteBarcode()
This function is used to delete selected barcode or min and after deleting push data to indexeddb. updateScannedData callback function checks deleted min/barcode has another entry in list, if entry is present then need to update valid flag as well as deleted return id. If localstorage is empty then it removes whole item.
# submitBarcodes()
This function check value stored is min or barcode from indexeddb. if its barcode and has validFlag=true then it sends data with returnId as {barcode:12344535,returnId:6576} and That barcode's validFlag is false then send data as {barcode:5645646454} Same applies in case of minId too. JSON object looks like [{min:909845, returnId:6768},{barcode:464757757578,returnId:6767},{min:909844},{barcode:464757757577}] and then call post API. It also checks App has internet connection or not, If internet connection is not there then It sends API call when internet is back