Created
June 9, 2019 09:43
-
-
Save beerose/90dcb4e603eeb9d42f7956e318e335e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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