Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0

fixed getTorrentById

Cette révision appartient à :
ayame-git 2017-05-04 15:51:16 +03:00
Parent 0cdde31be4
révision 16ad046162
1 fichiers modifiés avec 1 ajouts et 1 suppressions

Voir le fichier

@ -82,7 +82,7 @@ type HomeTemplateVariables struct {
func getTorrentById(id string) (Torrents, error) {
var torrent Torrents
if db.Order("torrent_id DESC").First(&torrent, "id = ?", html.EscapeString(id)).RecordNotFound() {
if db.Where("torrent_id = ?", id).Find(&torrent).RecordNotFound() {
return torrent, errors.New("Article is not found.")
}