Hi y’all … I’m stuck (again)! And I could really use some input ASAP, I need to get this off to the clients. I know I saw some post(s) about this a week or 2 ago, but now can’t seem to find an answer
I have a dynamic Member Profile page which displays the current user’s info from the database on the left (this is previously entered using a form) and then on the right, displays the dated they joined, and if they’re an active member (noted in DB by boolean) then a membership expiration date is calculated and shown, otherwise, some text appears notifying the user their membership is expired, and for each instance (active/expired) the button shown changes.
Preview expired member:
Preview active member (contact info removed for privacy):
I’ve worked out all of the other code (I think), and it’s fine in preview mode but only the MOST RECENT entry from the database shows up. In other words, in preview, I can see each individual member’s profile with their info and the correct dates & button, however, when I go to the live site, I only see the profile of the last person to register (not me!). I need to make sure the currently logged in user sees their profile page and only their profile page when they click on a button “my account”
I’ve synced the database, changed all the permissions to “anyone” …
So I think it’s in the code (below) and the issue lies with using getCurrentItem and/or my onReady – that it’s actually getting the most recent item, not the item associated with the current user.
Page Code (dynamic page, url: www…com/members/ID and database
data.js Backend Code (called for date calculation of 1-year membership expiration)
Also, you can see some of how I got to my code here, if it helps: https://www.wix.com/code/home/forum/questions-answers/working-with-dates-and-time-in-wix-code
Note: I used a variation on the “standard” member profile code to gather my member info, db and login page…
Please, please help! My brain’s turning into spaghetti I think
And THANK YOU in advance to anyone who’s got advice…!?