Jelajahi Sumber

fix: GetMaxUserId use Unscope, close #987

creamlike1024 11 bulan lalu
induk
melakukan
c2b33e3b23
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      model/user.go

+ 1 - 1
model/user.go

@@ -108,7 +108,7 @@ func CheckUserExistOrDeleted(username string, email string) (bool, error) {
 
 func GetMaxUserId() int {
 	var user User
-	DB.Last(&user)
+	DB.Unscoped().Last(&user)
 	return user.Id
 }