Skip to content

Commit d270f6f

Browse files
committed
fix: Read operations
1 parent 09046bb commit d270f6f

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ require (
4343
golang.org/x/net v0.0.0-20220907135653-1e95f45603a7 // indirect
4444
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
4545
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
46+
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
4647
)
4748

4849
require (

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN
346346
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
347347
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
348348
gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s=
349+
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
350+
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
349351
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
350352
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
351353
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

internal/liman/extension.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
)
1919

2020
func GetExtension(extension *models.Extension) (*models.Extension, error) {
21-
result := database.Connection().First(&extension)
21+
result := database.Connection().Where(&extension).First(&extension)
2222

2323
if result.Error != nil {
2424
return nil, logger.FiberError(fiber.StatusNotFound, "cannot found extension with this id")

internal/liman/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
func GetServer(server *models.Server) (*models.Server, error) {
11-
result := database.Connection().First(&server)
11+
result := database.Connection().Where(&server).First(&server)
1212

1313
if result.Error != nil {
1414
return nil, logger.FiberError(fiber.StatusNotFound, "cannot found server with this id")

internal/liman/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
func GetUser(user *models.User) (*models.User, error) {
11-
result := database.Connection().First(&user)
11+
result := database.Connection().Where(&user).First(&user)
1212

1313
if result.Error != nil {
1414
return nil, logger.FiberError(fiber.StatusNotFound, "cannot found user with this id")

0 commit comments

Comments
 (0)