Adding A Liking System with Wix Code

Custom Liking System Code:

import wixUsers from 'wix-users';

import wixData from 'wix-data';

import wixLocation from 'wix-location';

$w.onReady( () => {

if(wixUsers.currentUser.loggedIn) {

$w("#like").show();

}

else {

$w("#like").hide();

}

} );

export function like_click(event) {

wixData.insert('Likes',

{likedContent: $w('#UserStatuses').getCurrentItem()._id}),

$w('#contentLiked').show(),

$w('#like').hide();

}