bar code imaghe is saved to DB
This commit is contained in:
@@ -135,6 +135,7 @@ export const updateOrAddBill = withUser(async (user:AuthenticatedUser, locationI
|
||||
} = validatedFields.data;
|
||||
|
||||
const billPaid = formData.get('billPaid') === 'on';
|
||||
const barcodeImage = formData.get('barcodeImage')?.valueOf() as string;
|
||||
|
||||
// update the bill in the mongodb
|
||||
const dbClient = await getDbClient();
|
||||
@@ -151,11 +152,14 @@ export const updateOrAddBill = withUser(async (user:AuthenticatedUser, locationI
|
||||
"bills.$[elem].attachment": billAttachment,
|
||||
"bills.$[elem].notes": billNotes,
|
||||
"bills.$[elem].payedAmount": payedAmount,
|
||||
"bills.$[elem].barcodeImage": barcodeImage,
|
||||
|
||||
}: {
|
||||
"bills.$[elem].name": billName,
|
||||
"bills.$[elem].paid": billPaid,
|
||||
"bills.$[elem].notes": billNotes,
|
||||
"bills.$[elem].payedAmount": payedAmount,
|
||||
"bills.$[elem].barcodeImage": barcodeImage,
|
||||
};
|
||||
|
||||
// find a location with the given locationID
|
||||
@@ -186,7 +190,8 @@ export const updateOrAddBill = withUser(async (user:AuthenticatedUser, locationI
|
||||
paid: billPaid,
|
||||
attachment: billAttachment,
|
||||
notes: billNotes,
|
||||
payedAmount
|
||||
payedAmount,
|
||||
barcodeImage,
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user