Implemented common parameter validation

This commit is contained in:
Deluan
2016-03-03 14:14:15 -05:00
parent 053f4b72ba
commit 18b784f494
5 changed files with 18 additions and 12 deletions
+1 -4
View File
@@ -21,10 +21,7 @@ func (c *GetCoverArtController) Prepare() {
}
func (c *GetCoverArtController) Get() {
id := c.Input().Get("id")
if id == "" {
c.SendError(responses.ERROR_MISSING_PARAMETER, "id parameter required")
}
id := c.ValidateParameters("id", "id parameter required")
mf, err := c.repo.Get(id)
if err != nil {