diff options
author | jan <jan@ruken.pw> | 2015-12-29 21:44:46 (UTC) |
---|---|---|
committer | jan <jan@ruken.pw> | 2015-12-29 21:44:46 (UTC) |
commit | 365bd4578a0c9b2e4ae5938d280609bd9af37faf (patch) | |
tree | a08708be80b4293bd3766862910a03c12dbf2d4c /modules/grils | |
parent | 748fb25854694114a6b6941636dfe8bcfdb927ba (diff) |
simple pagination für tag-ansicht. außerdem wird nun ein leeres array bei grils.FromIDs zurückgegeben anstatt lustige sql fehler zu provozieren, wenn der ids array leer ist.
Diffstat (limited to 'modules/grils')
-rw-r--r-- | modules/grils/grils.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/grils/grils.go b/modules/grils/grils.go index 0df93a0..5d548e6 100644 --- a/modules/grils/grils.go +++ b/modules/grils/grils.go | |||
@@ -153,6 +153,10 @@ func (m *GrilsModule) FromID(id int) (*Gril, error) { | |||
153 | } | 153 | } |
154 | 154 | ||
155 | func (m *GrilsModule) FromIDs(ids []int) ([]*Gril, error) { | 155 | func (m *GrilsModule) FromIDs(ids []int) ([]*Gril, error) { |
156 | if len(ids) == 0 { | ||
157 | return make([]*Gril, 0), nil | ||
158 | } | ||
159 | |||
156 | idList := "(" | 160 | idList := "(" |
157 | first := true | 161 | first := true |
158 | for _, v := range ids { | 162 | for _, v := range ids { |