Skip to content

Instantly share code, notes, and snippets.



Created Dec 14, 2018
What would you like to do?
/** Fetch all conferences */
let selectConferencesQuery;
try {
selectConferencesQuery = await query(
'SELECT id, name, description, dates, tags, image FROM conferences'
} catch (e) {}
/** Fetch the count of subevents related to a conference */
const conferenceIds =
result =>
try {
await Promise.all( conferenceId => {
const countQuery = await query(
'SELECT COUNT(*) as count from conferences_subevents_mapping WHERE cid=?',
} catch (e) {}

This comment has been minimized.

Copy link
Owner Author

@tarang9211 tarang9211 commented Dec 14, 2018

This function is to get all the conferences. I do not need the list of subevents, I only need the count of it. I think with this method I will have to mutate the selectedConferences.results array and update the count manually. Is there a better suggestion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment