Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Update torrent.go

Cette révision appartient à :
Anthony D'Alessandro 2017-05-09 23:47:01 -04:00 révisé par GitHub
Parent 60ba3ba204
révision 245a6f9d2b

Voir le fichier

@ -174,7 +174,7 @@ func CreateWhereParams(conditions string, params ...string) WhereParams {
} }
func DeleteTorrent(id string) (int, error) { func DeleteTorrent(id string) (int, error) {
var torrent model.Torrents var torrent model.Torrent
if db.ORM.First(&torrent, id).RecordNotFound() { if db.ORM.First(&torrent, id).RecordNotFound() {
return http.StatusNotFound, errors.New("Torrent is not found.") return http.StatusNotFound, errors.New("Torrent is not found.")
} }
@ -184,7 +184,7 @@ func DeleteTorrent(id string) (int, error) {
return http.StatusOK, nil 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 { if db.ORM.Save(torrent).Error != nil {
return http.StatusInternalServerError, errors.New("Torrent is not updated.") return http.StatusInternalServerError, errors.New("Torrent is not updated.")
} }