1
0

Use the auth methods to get IDs to avoid unneeded casts

This commit is contained in:
kolaente
2019-06-28 10:21:48 +02:00
parent fc3c5f2187
commit f1d21ea52b
25 changed files with 65 additions and 146 deletions

View File

@ -84,12 +84,7 @@ func GetListsByNamespaceID(nID int64, doer *User) (lists []*List, err error) {
// @Failure 500 {object} models.Message "Internal error"
// @Router /lists [get]
func (l *List) ReadAll(search string, a web.Auth, page int) (interface{}, error) {
u, err := getUserWithError(a)
if err != nil {
return nil, err
}
lists, err := getRawListsForUser(search, u, page)
lists, err := getRawListsForUser(search, &User{ID: a.GetID()}, page)
if err != nil {
return nil, err
}