Adding new database items using hooks

Can anyone help me with this scenario?

I Have a database called Results which records the win/loss records of any game played by two people. Database(Results) is populated via a form which has several inputs. This portion is working fine.

Where I need some guidance!
Once the form submits the data and inserts it into the database I would like to have an afterinsert hook which will add an new entry into the same database with two of the fields manipulated… For example

Form connected to result database collects the following fields:
Your Name - person submitting form. This an input type
Opponent Name - This is a input type
Win/loss - This is a radio input type (Returning 1 for win, -1 for loss)

Database View Example after completing form and submitting
your_name | opp_name | win/loss

  1. Batman Joker 1

Database View Example after running afterinsert hook
your_name | opp_name | win/loss

  1. Batman Joker 1
  2. Joker Batman -1 (Needs some guidance getting to this item with hooks)

Thanks for your help it would be greatly appreciated.

Hi Darnell,

See the code below and my inline comments:

import wixData from 'wix-data';

export function results_afterInsert(item) {
 let options = { //The afterInsert hook runs every time we do an insert. to supress it from doing it we pass this parameter
 "suppressHooks": true
    };
 let newItem = { //new item to insert.
 "your_name": item.opp_name,
 "opp_name": item.your_name,
 "winOrLoss": item.winOrLoss * -1
    }
    wixData.insert("results", newItem, options)
        .then((results) => {
            console.log("done adding new item", results)
        })
        .catch((err) => {
            console.log(err);
        });
 return item;
}