Question:
Suddenly wix-data cannot query database anymore because WDE0149 error
Product:
Velo, Javasript
What are you trying to achieve:
I want to query data from my database with wix-data and send it to my personal Google Sheet, but encountered this error today:
WDE0149: Internal application error
According to the doc:
It was working before, for months, until today.
What have you already tried:
I tried to debug the code, but nothing worked. Here is the code that I removed the function call to send data to my sheet. The code only queries data from the database Store/Orders
and print them out:
export function save_orders() {
let query_options = {
"suppressAuth": true,
};
let durationInMinutes = 36000;
let prev_time = new Date();
let now = new Date();
prev_time.setMinutes(now.getMinutes() - durationInMinutes);
console.log("Prev time: " + prev_time);
wixData.query("Stores/Orders")
.gt('_dateCreated', prev_time)
.find(query_options)
.then( (results) => {
// matching items were found
console.log("Found results: " + results)
if(results.items.length > 0) {
for (let i of results.items) {
console.log(i)
}
}
}
).catch((err) => {
console.log(err);
})
}
EDIT: Actually, previously the query code allowed options:
wixData.query("Stores/Orders", query_options)
But today when I logged in, the API was not valid anymore, so I push query_options
tofind()
but it doesn’t seem to work.