aboutsummaryrefslogtreecommitdiff
path: root/modules/grils
diff options
context:
space:
mode:
Diffstat (limited to 'modules/grils')
-rw-r--r--modules/grils/grils.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/grils/grils.go b/modules/grils/grils.go
index 7ea5259..46d0fb3 100644
--- a/modules/grils/grils.go
+++ b/modules/grils/grils.go
@@ -156,6 +156,22 @@ func (m *GrilsModule) FromID(id int) (*Gril, error) {
156 return gril, nil 156 return gril, nil
157} 157}
158 158
159func (m *GrilsModule) FromIDs(ids []int) ([]*Gril, error) {
160 idList := "("
161 first := true
162 for _, v := range ids {
163 if first {
164 first = false
165 } else {
166 idList += ","
167 }
168 idList += strconv.Itoa(v)
169 }
170 idList += ")"
171 grils, err := m.getGrils("id IN " + idList)
172 return grils, err
173}
174
159func (m *GrilsModule) viewGril(w http.ResponseWriter, r *http.Request, p httprouter.Params) { 175func (m *GrilsModule) viewGril(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
160 user, _ := m.g.Charakterin.GetUserFromRequest(r) 176 user, _ := m.g.Charakterin.GetUserFromRequest(r)
161 sid := p.ByName("id") 177 sid := p.ByName("id")