Skip to content

Instantly share code, notes, and snippets.

@beerose
Created June 9, 2019 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beerose/90dcb4e603eeb9d42f7956e318e335e4 to your computer and use it in GitHub Desktop.
Save beerose/90dcb4e603eeb9d42f7956e318e335e4 to your computer and use it in GitHub Desktop.
export const listMeetings = (
groupId: GroupDTO['id'],
callback: QueryCallback
) =>
connection.query(
{
sql: /* sql */ `
SELECT
id, meeting_name, group_id, date
FROM
meetings
WHERE
group_id = ?
ORDER BY date DESC
`,
typeCast: (field, orig) => {
return field.type === 'DATE' ? new Date(field.string()) : orig();
},
values: [groupId],
},
callback
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment