🐛 Fixed missing code in sqlite3 session repository output

This commit is contained in:
Maxim Lebedev 2022-02-18 02:46:31 +05:00
parent 8bee5c8559
commit 2a6c3a3447
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
2 changed files with 7 additions and 0 deletions

View File

@ -77,6 +77,8 @@ func (repo *sqlite3SessionRepository) Get(ctx context.Context, code string) (*do
return nil, fmt.Errorf("cannot decode session data from store: %w", err)
}
result.Code = code
return result, nil
}
@ -116,6 +118,8 @@ func (repo *sqlite3SessionRepository) GetAndDelete(ctx context.Context, code str
return nil, fmt.Errorf("cannot decode session data from store: %w", err)
}
result.Code = code
return result, nil
}

View File

@ -19,6 +19,7 @@ func TestCreate(t *testing.T) {
t.Parallel()
session := domain.TestSession(t)
session.Profile = nil
model, err := repository.NewSession(session)
if err != nil {
@ -47,6 +48,7 @@ func TestGet(t *testing.T) {
t.Parallel()
session := domain.TestSession(t)
session.Profile = nil
model, err := repository.NewSession(session)
if err != nil {
@ -81,6 +83,7 @@ func TestGetAndDelete(t *testing.T) {
t.Parallel()
session := domain.TestSession(t)
session.Profile = nil
model, err := repository.NewSession(session)
if err != nil {