From 245a6f9d2bb8560c12963c887aa90fbed947d0bd Mon Sep 17 00:00:00 2001 From: Anthony D'Alessandro Date: Tue, 9 May 2017 23:47:01 -0400 Subject: [PATCH] Update torrent.go --- service/torrent/torrent.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/torrent/torrent.go b/service/torrent/torrent.go index b29d6046..7f204ced 100644 --- a/service/torrent/torrent.go +++ b/service/torrent/torrent.go @@ -174,7 +174,7 @@ func CreateWhereParams(conditions string, params ...string) WhereParams { } func DeleteTorrent(id string) (int, error) { - var torrent model.Torrents + var torrent model.Torrent if db.ORM.First(&torrent, id).RecordNotFound() { return http.StatusNotFound, errors.New("Torrent is not found.") } @@ -184,7 +184,7 @@ func DeleteTorrent(id string) (int, error) { return http.StatusOK, nil } -func UpdateTorrent(torrent model.Torrents) (int, error) { +func UpdateTorrent(torrent model.Torrent) (int, error) { if db.ORM.Save(torrent).Error != nil { return http.StatusInternalServerError, errors.New("Torrent is not updated.") }