Refactor Issues Subscription (#8738)
* FIX: getIssueWatchers() get only aktive suscriber * save query to work later with it or not ... * fix test + add new case * corect tests + GetIssueWatch * API issue_subscripton: Put/Delete require tocken * remove redundant code * swagger specify return value * remove unused binding * remove note because I'll implement this in a different way and in another PR * ID should be unique! * use xorm session * Revert "use xorm session" This reverts commit c1de540147199f2f1a8dd0d008f54af3603e2229. * better test code * more acurate comments * use assert.False/True instead of Equal * use more assert methodes
This commit is contained in:
parent
dfd8b94923
commit
2ab8c78c30
6 changed files with 47 additions and 52 deletions
|
@ -691,9 +691,9 @@ func RegisterRoutes(m *macaron.Macaron) {
|
|||
m.Post("/stop", reqToken(), repo.StopIssueStopwatch)
|
||||
})
|
||||
m.Group("/subscriptions", func() {
|
||||
m.Get("", bind(api.User{}), repo.GetIssueSubscribers)
|
||||
m.Put("/:user", repo.AddIssueSubscription)
|
||||
m.Delete("/:user", repo.DelIssueSubscription)
|
||||
m.Get("", repo.GetIssueSubscribers)
|
||||
m.Put("/:user", reqToken(), repo.AddIssueSubscription)
|
||||
m.Delete("/:user", reqToken(), repo.DelIssueSubscription)
|
||||
})
|
||||
})
|
||||
}, mustEnableIssuesOrPulls)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue