From d34833d192e49b8c931c35ad52c37b2df0f21700 Mon Sep 17 00:00:00 2001 From: Christopher James Hayward Date: Mon, 17 Jul 2023 10:49:52 -0400 Subject: [PATCH] Fix references --- server/models/role.go | 2 +- server/models/user.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/models/role.go b/server/models/role.go index 907af43..86c69b6 100644 --- a/server/models/role.go +++ b/server/models/role.go @@ -5,5 +5,5 @@ import "gorm.io/gorm" type Role struct { gorm.Model Name string - Users []User + Users []*User `gorm:"many2many:user_roles;"` } diff --git a/server/models/user.go b/server/models/user.go index 02ceb66..63994e5 100644 --- a/server/models/user.go +++ b/server/models/user.go @@ -7,6 +7,6 @@ type User struct { UUID string Email string Password string - Roles []Role - Sessions []Session + Roles []*Role `gorm:"many2many:user_roles;"` + Sessions []*Session }