HTTP API documentation +fix when updating a playlist (#12612)
* get id from path param when updating a playlist * add playlist http api documentation * remove required condition for the id in update cmd
This commit is contained in:
committed by
Torkel Ödegaard
parent
b526150578
commit
05e060dee0
@@ -160,6 +160,7 @@ func CreatePlaylist(c *m.ReqContext, cmd m.CreatePlaylistCommand) Response {
|
||||
|
||||
func UpdatePlaylist(c *m.ReqContext, cmd m.UpdatePlaylistCommand) Response {
|
||||
cmd.OrgId = c.OrgId
|
||||
cmd.Id = c.ParamsInt64(":id")
|
||||
|
||||
if err := bus.Dispatch(&cmd); err != nil {
|
||||
return Error(500, "Failed to save playlist", err)
|
||||
|
||||
@@ -63,7 +63,7 @@ type PlaylistDashboards []*PlaylistDashboard
|
||||
|
||||
type UpdatePlaylistCommand struct {
|
||||
OrgId int64 `json:"-"`
|
||||
Id int64 `json:"id" binding:"Required"`
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name" binding:"Required"`
|
||||
Interval string `json:"interval"`
|
||||
Items []PlaylistItemDTO `json:"items"`
|
||||
|
||||
Reference in New Issue
Block a user