top of page
Forum Posts
Ella
May 17, 2019
In Coding with Velo
Hi
I have followed the "wishlist" code from Code Queen Nayeli, as presented here; https://www.totallycodable.com/forum/codes-for-templates/wish-list-add-to-favorites I have followed the code strict, but, for me, something strange happens.
In page corresponding to "MyWishlist", I can sometimes see a glimpse of the added items, but mostly they are not added to the repeater. The items are added to the database, but not added/visible in the repeater. In the console log, I can see "onReady callback registered", and "currentIndexChanged event".
Guess the error (and the solution) is connected to this..... In my search for enlightening, I found this forum-thread: https://www.wix.com/corvid/forum/community-discussion/filter-database-error-an-error-occurred-in-one-of-currentindexchanged-callbacks
My error seems quite the same, but not the solution...
I do not have the knowledge to figure out what is going on - on another test-site, it used to work.
I have triple-checked the permissions, datasets etc. Can someone clarify me on this? Thank you SO MUCH for your help in advance:-) For reference, I add the code and a link to my site page:
https://editor.wix.com/html/editor/web/renderer/edit/f0ed6faa-2879-4792-a595-893dcbe154d4?metaSiteId=fb1b61f0-deb1-4783-85a3-85b04b19bea6&editorSessionId=0b963381-5383-5ce7-9af1-c273fea404ff import wixUsers from 'wix-users';
import wixData from 'wix-data';
$w.onReady(function () {
getfilters();
});
function getfilters() {
let user = wixUsers.currentUser;
let userId = user.id;
console.log(userId);
wixData.query("mittarbeid")
.eq("userId", userId)
.find()
.then((results) => {
let items = results.items;
let firstItem = items[0];
var prod = [];
var i = 0;
console.log(results.length);
var vf = results.length;
$w("#text36").text = userId;
while (i < vf) {
console.log(i);
prod[i] = items[i].productId;
console.log(items[i].productId);
i = i + 1;
console.log(prod[i]);
}
console.log(prod);
$w("#dsAndelsarbeid").setFilter(wixData.filter()
.hasSome("name", prod)
);
});
0
4
100
Ella
Mar 19, 2019
In Coding with Velo
I have created a simple "Custom Log In / Sign On Screen" using the code below. Works fine, but it seems the catch error is not working, because nothing happens when typing wrong email/password. The error message is still hidden. But when typing in correct info, it works fine. What is wrong, any idea? Thanks:-) import wixUsers from 'wix-users'; import wixLocation from 'wix-location'; import wixWindow from 'wix-window'; $w.onReady(function () { $w("#forgotPassword").onClick( (event) => { //wixWindow.lightbox.close() wixUsers.promptForgotPassword() .then( ( ) => { // } ) .catch( (err) => { let errorMsg = err; //"The user closed the forgot password dialog" }); }); }); export function loginButton_click(event) { let email = $w("#email").value; let password = $w("#password").value; wixUsers.login(email, password) .then( () => { console.log("User is logged in"); wixLocation.to("/account/my-account"); //Change the URL ending to whatever page you want to send the user to after they log in. } ) .catch( (err) => { console.log(err); $w("#errorMessage").expand(); // You can delete this line if you are not going to add an error message. Use a regular text element set to 'collapse on load' from the Properties Panel. } ); }
0
6
443
Ella
More actions
bottom of page