Created
November 16, 2021 19:06
-
-
Save KevinStrong/1ada9a2fb58ad24da40dc090d8759bcb to your computer and use it in GitHub Desktop.
A golang function to query for a kioskEvent's checkins using gorm
This file contains hidden or 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
| func getKioskEvent(kioskID, eventID uint, db *gorm.DB) (KioskEvent, error) { | |
| kioskEvent := KioskEvent{} | |
| result := db.Preload("Checkins").Where(&KioskEvent{KioskID: kioskID, EventID: eventID}).First(&kioskEvent) | |
| return kioskEvent, result.Error | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment