top of page

Forum Posts

Sam Gong
May 02, 2020
In Coding with Velo
It seems that getRoles() function stopped working from backend. It returns "Not Found: the requested item no longer exists." It was working several days ago. I tried on two websites and both had the same issue. However, getRoles() function at frondend still works. Below is my backend code if it helps. Nothing fancy though. // Filename: backend/aModule.jsw (web modules need to have a .jsw extension) import wixUsersBackend from 'wix-users-backend'; export async function getUserRoles() { try { let user = wixUsersBackend.currentUser; if (!user.loggedIn) throw new Error("user not logged in"); const roles = await user.getRoles(); return roles; } catch ({ message }) { return {error: message}; } }
0
1
38
Sam Gong
Apr 25, 2020
In Coding with Velo
The events.js (in Backend folder) is as below: import wixData from 'wix-data'; import wixStores from 'wix-stores-backend'; export function wixStores_onCartCreated(event) { console.log("onCartCreated triggered"); wixData.insert("Logs", { details: "onCartCreated triggered", }); } export function wixStores_onCartAbandoned(event) { console.log("onCartAbandoned triggered"); wixData.insert("Logs", { details: "onCartAbandoned triggered", }); } The "Logs" collection permission has been set to Anyone for view/create/update/delete I tested in live website. When I add an item to the cart or empty the cart, no entry shows up in the "Logs" collection and nothing in the Site Monitoring window. I have searched the web and this forum including the following link whose solution does not solve my case: https://www.wix.com/corvid/forum/community-discussion/how-setup-the-oncartcreated-events-wix-stores-backend?origin=auto_suggest
2
2
652

Sam Gong

More actions
bottom of page