Hello,
I have an issue when registering a form into a database
I have added an hook after the insert and when I run the form nothing happen
So I open the web inspector and with the console error I can see the following message :
"Wix code SDK error: The url parameter that is passed to the to method cannot be set to the value . It must be of type string."
I suppose that something is wrong with the code written
I do not know javascript as well as other old languages but if someone can tell me what's going wrong it would be really appreciate. He is the code used :
import wixLocation from 'wix-location'; // In data.js export function Cotation_afterInsert(item, context) { //TODO: write your code here... let hookContext = context; // see below // some changes to the received item if (item.numero_adherent === "" ) { wixLocation.to("/paiement-adhesion") } else if (item.numero_adherent === '0') { wixLocation.to("/paiement-adhesion") } return item; }
If I understand well the message says that the parameter for the wix.location.to should be of type string but for me enclosed by double quote means string