Small update to update account command
This commit is contained in:
+1
-8
@@ -18,14 +18,7 @@ func GetAccount(c *middleware.Context) {
|
||||
c.JSON(200, query.Result)
|
||||
}
|
||||
|
||||
func UpdateAccount(c *middleware.Context) {
|
||||
cmd := m.UpdateAccountCommand{}
|
||||
|
||||
if !c.JsonBody(&cmd) {
|
||||
c.JsonApiErr(400, "Invalid request", nil)
|
||||
return
|
||||
}
|
||||
|
||||
func UpdateAccount(c *middleware.Context, cmd m.UpdateAccountCommand) {
|
||||
cmd.AccountId = c.AccountId
|
||||
|
||||
if err := bus.Dispatch(&cmd); err != nil {
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ func Register(r *macaron.Macaron) {
|
||||
// account
|
||||
r.Group("/account", func() {
|
||||
r.Get("/", GetAccount)
|
||||
r.Post("/", UpdateAccount)
|
||||
r.Post("/", bind(m.UpdateAccountCommand{}), UpdateAccount)
|
||||
r.Put("/collaborators", bind(m.AddCollaboratorCommand{}), AddCollaborator)
|
||||
r.Get("/collaborators", GetCollaborators)
|
||||
r.Delete("/collaborators/:id", RemoveCollaborator)
|
||||
|
||||
Reference in New Issue
Block a user