fix: game7 user not exist role bug
This commit is contained in:
@@ -48,10 +48,14 @@ GROUP BY
|
||||
`
|
||||
var resp GameReport
|
||||
err := m.conn.QueryRowCtx(ctx, &resp, query, email)
|
||||
if err != nil && !errors.Is(err, sqlx.ErrNotFound) {
|
||||
switch {
|
||||
case err == nil:
|
||||
return &resp, nil
|
||||
case errors.Is(err, sqlx.ErrNotFound):
|
||||
return nil, ErrNotFound
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
// NewNhGameReportModel returns a model for the database table.
|
||||
|
||||
Reference in New Issue
Block a user