here is the error
Unhandled Rejection (Error): Invalid function: "fetchAllMemes"
15 | }, []); 16 | 17 | const fetchMemeOfTheDay = async () => {> 18 | let memes = await Moralis.Cloud.run(âfetchAllMemesâ); | ^ 19 | // console.log(memes); 20 | 21 | //Filters out all memes by vote count of last 24hours!
THIS IS MY CLOUD FUNCTION
const fetchMemeOfTheDay = async () => {
let memes = await Moralis.Cloud.run("fetchAllMemes");
console.log(memes);
let oneDay = 24 * 60 * 60 * 1000;
console.log(oneDay);
let posts = [];
const filteredMemes = memes.filter((meme) => {
return meme.voters.find((currentTimestamp) =>
currentTimestamp.timestamp >= Date.now() - oneDay ? posts.push(meme) : ""
);
});
console.log("FM", filteredMemes);
const highestVotes = filteredMemes.sort((a, b) => {
return b.voters.length - a.voters.length;
});
setRanking();
setRanking(highestVotes);
};
ERROR FROM MY MORALIS DASBOARD
2022-01-27T17:46:06.997Z - Error: Invalid function: "fetchAllMemes"
at handleCloudFunction (/moralis-server/lib/Routers/FunctionsRouter.js:119:13)
at /moralis-server/lib/PromiseRouter.js:85:20
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)