mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-25 21:26:40 +00:00
[bugfix] fix get all tokens (#2841)
This commit is contained in:
parent
3cceed11b2
commit
6de5717d7f
|
@ -153,7 +153,7 @@ func(uncached []string) ([]*gtsmodel.Token, error) {
|
||||||
// Perform database query scanning
|
// Perform database query scanning
|
||||||
// the remaining (uncached) token IDs.
|
// the remaining (uncached) token IDs.
|
||||||
if err := a.db.NewSelect().
|
if err := a.db.NewSelect().
|
||||||
Model(tokens).
|
Model(&tokens).
|
||||||
Where("? IN (?)", bun.Ident("id"), bun.In(uncached)).
|
Where("? IN (?)", bun.Ident("id"), bun.In(uncached)).
|
||||||
Scan(ctx); err != nil {
|
Scan(ctx); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -123,6 +123,14 @@ func (suite *ApplicationTestSuite) TestDeleteApplicationBy() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (suite *ApplicationTestSuite) TestGetAllTokens() {
|
||||||
|
tokens, err := suite.db.GetAllTokens(context.Background())
|
||||||
|
if err != nil {
|
||||||
|
suite.FailNow(err.Error())
|
||||||
|
}
|
||||||
|
suite.NotEmpty(tokens)
|
||||||
|
}
|
||||||
|
|
||||||
func TestApplicationTestSuite(t *testing.T) {
|
func TestApplicationTestSuite(t *testing.T) {
|
||||||
suite.Run(t, new(ApplicationTestSuite))
|
suite.Run(t, new(ApplicationTestSuite))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue