I can’t save my site when I edit the backend/events.js. I have added some code to event.js but when I hit save it’s just loading. Please, help me my death end is near.
https://support.wix.com/en/article/4-june-2020-unable-to-save-code-changes-in-the-corvid-ide
It seems everyone is facing the same issue
This issue sounds more like a system issue than a coding problem. I suggest you contact Wix Customer Care for this as they will be able to help you better.
Hi, Yisrael. I hope you’re safe. Now I can able to save my site but the function is not working.
This is my code. It was worked before I added a few lines. But not now.
I have checked the data collection permissions it was set all to anyone.
import wixData from 'wix-data';
import wixStores from 'wix-stores-backend';
import wixPayBackend from 'wix-pay-backend';
import wixBillingBackend from 'wix-billing-backend';
export function wixStores_onNewOrder(event) {
let newOrderId = event.orderId;
let OrderNo = event.number;
let PaymentStatus = event.paymentStatus;
let FulfillmentStatus = event.fulfillmentStatus;
let ShippingAddress = event.shippingInfo.shipmentDetails.address.addressLine;
let ShippingCity = event.shippingInfo.shipmentDetails.address.city;
let ShippingState = event.shippingInfo.shipmentDetails.address.subdivision;
let ShippingCountry = event.shippingInfo.shipmentDetails.address.country;
let ShippingPostalCode = event.shippingInfo.shipmentDetails.address.postalCode;
let BillingAddress = event.billingInfo.address.addressLine;
let BillingCity = event.billingInfo.address.city;
let BillingState = event.billingInfo.address.subdivision;
let BillingCountry = event.billingInfo.address.country;
let BillingPostalCode = event.billingInfo.address.postalCode;
let BuyerFirstName = event.buyerInfo.firstName;
let BuyerLastName = event.buyerInfo.lastName;
let BuyerEmail = event.buyerInfo.email;
let BuyerPhone = event.buyerInfo.phone;
let CreatedDate = event._dateCreated;
let LineItems = event.lineItems;
let TotalQuantity = event.totals.quantity;
let TotalPrice = event.totals.total;
let UserID = event.enteredBy;
let toInsert = {
"orderId": newOrderId,
"orderNo": OrderNo,
"_createdDate": newOrderId,
"buyerFullName": OrderNo,
"buyerEmail": newOrderId,
"buyerPhone": OrderNo,
"paymentStatus": newOrderId,
"fulfillmentStatus": OrderNo,
"lineItems": newOrderId,
"shippingStreetAddress": FulfillmentStatus,
"shippingCity": OrderNo,
"shippingState": newOrderId,
"shippingCountry": OrderNo,
"shippingPostalCode": PaymentStatus,
"billingStreetAddress": FulfillmentStatus,
"billingCity": OrderNo,
"billingState": newOrderId,
"billingCountry": OrderNo,
"billingPostalCode": PaymentStatus,
"TotalQuantity": OrderNo,
"TotalPrice": PaymentStatus
};
wixData.insert('Logs', toInsert)
}
export function wixPay_onPaymentUpdate(event) {
let PaymentId = event.payment.id;
let TransactionId = event.transactionId;
let NewTransactionStatus = event.status;
let fullname1 = event.userInfo.firstName + event.userInfo.lastName;
let email1 = event.userInfo.email;
let phone1 = event.userInfo.phone;
let amount1 = event.payment.amount;
let toInsert = {
"paymentId": PaymentId,
"transactionId": TransactionId,
"paymentStatus": NewTransactionStatus
};
wixData.insert('custom-order', toInsert)
let toInsert1 = {
"paymentId": PaymentId,
"transactionId": TransactionId,
"paymentStatus": NewTransactionStatus,
"fullName": fullname1,
"email": email1,
"phone": phone1,
"amount": amount1
};
wixData.insert('customOrderLogs', toInsert1)
}
export function wixBilling_onInvoiceCreated(event) {
let invoiceId = event.id.id;
let email = event.customer.email;
}
You state, " It was worked before I added a few lines. But not now."
I would suggest you go back to the previous working version. You can restore a previous version from the site history .
If you continue to have problems, understand that we are unable to debug or rewrite complex code and page configurations. If you feel that there is a bug in Corvid, then please try to create a test page with the minimum scenario in which the problem appears, to help us investigate the issue properly.