Fetching current page data and sending to Database.

Hi
I am trying to get the “ID” of the current user who is logged in and the ID of the post that he “likes/clicks button”. And store these IDs in a database as Foreign Keys or references.

I have tried to put in a very crude website code which isn’t working:

import wixData from 'wix-data';
import wixUsers from 'wix-users';
import wixSite from 'wix-site-backend';
$w.onReady(function () {
});

export function iconButton1_click(event) {

let user = wixUsers.currentUser;
let post = wixSite.currentPost;
let userId = user.id;           
let postId = post.id;
let isLoggedIn = user.loggedIn;
let toUpdate = {
 "MemberID":          userId,
 "POSTID": postId,
};

let options = {
 "suppressAuth": true,
 "suppressHooks": true
};

wixData.update("LIKES", toUpdate, options) //Database where I am sending the IDs is "LIKES"
  .then( (results) => {
 let item = results; //see item below
  } )
  .catch( (err) => {
 let errorMsg = err;
  } 
 );}

Please help me out