generated from lucien/api-template
Fix owner ID reference in share purchase logic; clean up comments and add sleep in main execution
This commit is contained in:
parent
9b0985c33c
commit
f351b4c31f
3 changed files with 3 additions and 35 deletions
|
@ -51,7 +51,7 @@ router.post('/buy', async (req, res) => {
|
|||
|
||||
await addTransaction(connection, price, share[0].owner_id, buyer_id, share_id)
|
||||
await setShareOwner(connection, share_id, buyer_id)
|
||||
if (share[0].owner != -1) {
|
||||
if (share[0].owner_id != -1) {
|
||||
const seller = await getShareholder(connection, share[0].owner_id)
|
||||
await setShareholderCapital(connection, share[0].owner_id, seller[0].capital + price)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue