aboutsummaryrefslogtreecommitdiff
path: root/modules/lists/lists.go
diff options
context:
space:
mode:
authorjan <jan@ruken.pw>2016-10-09 12:36:15 (UTC)
committerjan <jan@ruken.pw>2016-10-09 12:36:15 (UTC)
commitacd30d1105369347ee8c837c586b8c5f0b6cfcad (patch)
treed83e957cb967daed7a2d02998776aa8daf39021a /modules/lists/lists.go
parent924f63a7ffbd661d64c1d04547076ea4a31d1739 (diff)
beim API aufruf eine Kopie erstellen
Diffstat (limited to 'modules/lists/lists.go')
-rw-r--r--modules/lists/lists.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/lists/lists.go b/modules/lists/lists.go
index 67856fe..ee0eb68 100644
--- a/modules/lists/lists.go
+++ b/modules/lists/lists.go
@@ -499,13 +499,21 @@ func (m *Module) APIgetUserLists(w http.ResponseWriter, r *http.Request, p httpr
499 } 499 }
500 500
501 lists := m.GetUserLists(user, false) 501 lists := m.GetUserLists(user, false)
502 var pubLists []List
502 503
503 for _, list := range lists { 504 for _, list := range lists {
504 // owner wegen SICHERHEIT rausfiltern (nodumppassword2k16) 505 // owner wegen SICHERHEIT rausfiltern (nodumppassword2k16)
505 list.Owner = nil 506 // list.Owner = nil
507 var tempList List
508 tempList.Description = list.Description
509 tempList.ForkOf = list.ForkOf
510 tempList.ID = list.ID
511 tempList.Name = list.Name
512 tempList.UpdatedAt = list.UpdatedAt
513 pubLists = append(pubLists, tempList)
506 } 514 }
507 515
508 data, err := json.Marshal(&lists) 516 data, err := json.Marshal(&pubLists)
509 if err != nil { 517 if err != nil {
510 log.Println(err) 518 log.Println(err)
511 http.Error(w, "500", http.StatusInternalServerError) 519 http.Error(w, "500", http.StatusInternalServerError)