WIP: adds API check to stop folders being included in folders

This commit is contained in:
Daniel Lee
2017-06-16 02:45:21 +02:00
parent 7a39578f33
commit dd02bf7c9b
3 changed files with 30 additions and 5 deletions

View File

@ -194,6 +194,10 @@ func PostDashboard(c *middleware.Context, cmd m.SaveDashboardCommand) Response {
return ApiError(403, "Does not have permission to save this dashboard", nil)
}
if dash.IsFolder && dash.ParentId > 0 {
return ApiError(400, m.ErrDashboardFolderCannotHaveParent.Error(), nil)
}
// Check if Title is empty
if dash.Title == "" {
return ApiError(400, m.ErrDashboardTitleEmpty.Error(), nil)