Add routes for creating and removing subscriptions
This commit is contained in:
parent
eed15af70f
commit
3d94b489cd
|
@ -41,7 +41,7 @@ type Subscription struct {
|
|||
EntityType SubscriptionEntityType `xorm:"index not null" json:"-"`
|
||||
Entity string `xorm:"-" json:"-" param:"entity"`
|
||||
// The id of the entity to subscribe to.
|
||||
EntityID int64 `xorm:"bigint index not null" json:"entity_id"`
|
||||
EntityID int64 `xorm:"bigint index not null" json:"entity_id" param:"entityID"`
|
||||
|
||||
// The user who made this subscription
|
||||
User *user.User `xorm:"-" json:"user"`
|
||||
|
|
|
@ -512,6 +512,15 @@ func registerAPIRoutes(a *echo.Group) {
|
|||
a.DELETE("/teams/:team/members/:user", teamMemberHandler.DeleteWeb)
|
||||
a.POST("/teams/:team/members/:user/admin", teamMemberHandler.UpdateWeb)
|
||||
|
||||
// Subscriptions
|
||||
subscriptionHandler := &handler.WebHandler{
|
||||
EmptyStruct: func() handler.CObject {
|
||||
return &models.Subscription{}
|
||||
},
|
||||
}
|
||||
a.PUT("/subscriptions/:entity/:entityID", subscriptionHandler.CreateWeb)
|
||||
a.DELETE("/subscriptions/:entity/:entityID", subscriptionHandler.DeleteWeb)
|
||||
|
||||
// Migrations
|
||||
m := a.Group("/migration")
|
||||
|
||||
|
|
Loading…
Reference in New Issue