AlbumRest icon indicating copy to clipboard operation
AlbumRest copied to clipboard

Wrong return-type in AlbumRestController.php in the update()

Open roman-1983 opened this issue 12 years ago • 3 comments

There is an error in the AlbumRestController.php in the update() function. It should not return a JsonModel but only the result of the get() because get() already returns a JsonModel.

public function update($id, $data)
{
    // code here
    return $this->get($id);
}

instead of

public function update($id, $data)
{
    // code here
    return new JsonModel(array(
        'data' => $this->get($id),
    ));
}

roman-1983 avatar Feb 28 '13 10:02 roman-1983

Hi, thx for noticing this. Sorry i did not check earlier was quite busy. Would it be possible to send in a pr?

Hounddog avatar Mar 15 '13 00:03 Hounddog

Ithem with create function

franbueno avatar Jun 26 '13 15:06 franbueno

Hi, thanks for the explanation in restful implementation of album, i have a small doubt on the above, being simply return as a json data, can we say its implemented in restful?

mubarakaxonytes avatar Jan 06 '15 10:01 mubarakaxonytes