here is my backend functional call:
public query func getAllParties() : async [Text] {
let parties = Iter.toArray(mapOfPartyListing.keys());
return parties;
};
Have imported this canister to the frontend as follows:
import { ElecureV1_backend } from ‘@/declarations/ElecureV1_backend’;
and try to call the function:
async function getTeams() {
// try {
const allParties = await ElecureV1_backend.getAllParties();
console.log(allParties);
const allPartiesArray = Array.from(allParties);
console.log(allPartiesArray);
// } catch (error) {
// console.error(error);
// }
}
useEffect(() => {
getTeams();
}, );