Letās go go go!
Hmmm, got a bit of a surprise today. Just started up my app from VSC and am now getting an error that my cloud function is invalid. I havenāt changed any code and it has been working flawlessly since I created it a few days ago. I thought maybe I need to update the server, but updating says it requires my cloud function to be clear of errors.
Here is the cloud function, but again, this has been working no problem for days?
Moralis.Cloud.define("renderProjects", async (request) => {
const query = new Moralis.Query("Projects");
query.select('creatorProfilePic', 'title','projectPhoto', 'summary', 'date','description', 'creator.username', 'creator.profilePic', 'createdAt')
query.descending('createdAt')
const queryResults = await query.find({useMasterKey:true});
const results = [];
for (let i = 0; i < queryResults.length; ++i) {
results.push({
"username": queryResults[i].attributes.creator.attributes.username,
"profilePic": queryResults[i].attributes.creator.attributes.profilePic._url,
"title": queryResults[i].attributes.title,
"projectPhoto": queryResults[i].attributes.projectPhoto._url,
"summary": queryResults[i].attributes.summary,
"createdOn": queryResults[i].attributes.date,
"description": queryResults[i].attributes.description,
});
}
return results;
});