diff options
Diffstat (limited to 'server/guest')
-rw-r--r-- | server/guest/models.go | 18 | ||||
-rw-r--r-- | server/guest/store.go | 12 |
2 files changed, 15 insertions, 15 deletions
diff --git a/server/guest/models.go b/server/guest/models.go index 5cd1b8b..f792789 100644 --- a/server/guest/models.go +++ b/server/guest/models.go @@ -3,17 +3,17 @@ package guest import "github.com/golang-jwt/jwt/v5" type Guest struct { - ID int `json:"id"` - FirstName string `json:"firstName"` - LastName string `json:"lastName"` - Attendance string `json:"attendance"` - Email string `json:"email"` - Message string `json:"message"` - PartySize int `json:"partySize"` - PartyList []PartyGuest `json:"partyList"` + ID int `json:"id"` + FirstName string `json:"firstName"` + LastName string `json:"lastName"` + Attendance string `json:"attendance"` + Email string `json:"email"` + Message string `json:"message"` + PartySize int `json:"partySize"` + PartyList []PartyMember `json:"partyList"` } -type PartyGuest struct { +type PartyMember struct { FirstName string `json:"firstName"` LastName string `json:"lastName"` } diff --git a/server/guest/store.go b/server/guest/store.go index 4290f8f..44fa6d7 100644 --- a/server/guest/store.go +++ b/server/guest/store.go @@ -65,13 +65,13 @@ func addParty(guestWithoutParty Guest, partyRows pgx.Rows) (Guest, error) { guestWithParty := guestWithoutParty for partyRows.Next() { var guestID int - var partyGuest PartyGuest - err := partyRows.Scan(&guestID, &partyGuest.FirstName, &partyGuest.LastName) + var partyMember PartyMember + err := partyRows.Scan(&guestID, &partyMember.FirstName, &partyMember.LastName) if err != nil { return Guest{}, err } if guestID == guestWithParty.ID { - guestWithParty.PartyList = append(guestWithParty.PartyList, partyGuest) + guestWithParty.PartyList = append(guestWithParty.PartyList, partyMember) } } return guestWithParty, nil @@ -123,14 +123,14 @@ func addPartySlice(guestsWithoutParty []Guest, guestsWithParty := guestsWithoutParty for partyRows.Next() { var guestID int - var partyGuest PartyGuest - err := partyRows.Scan(&guestID, &partyGuest.FirstName, &partyGuest.LastName) + var partyMember PartyMember + err := partyRows.Scan(&guestID, &partyMember.FirstName, &partyMember.LastName) if err != nil { return []Guest{}, err } for i, guest := range guestsWithParty { if guestID == guest.ID { - guestsWithParty[i].PartyList = append(guest.PartyList, partyGuest) + guestsWithParty[i].PartyList = append(guest.PartyList, partyMember) } } } |