mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-28 03:00:03 +02:00
work on #1493
This commit is contained in:
parent
875f917771
commit
407385db7e
9 changed files with 111 additions and 71 deletions
|
@ -1435,9 +1435,9 @@ func NotifyWatchers(act *Action) error {
|
|||
// \/ \/
|
||||
|
||||
type Star struct {
|
||||
Id int64
|
||||
Uid int64 `xorm:"UNIQUE(s)"`
|
||||
RepoId int64 `xorm:"UNIQUE(s)"`
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
UID int64 `xorm:"uid UNIQUE(s)"`
|
||||
RepoID int64 `xorm:"UNIQUE(s)"`
|
||||
}
|
||||
|
||||
// Star or unstar repository.
|
||||
|
@ -1446,7 +1446,7 @@ func StarRepo(uid, repoId int64, star bool) (err error) {
|
|||
if IsStaring(uid, repoId) {
|
||||
return nil
|
||||
}
|
||||
if _, err = x.Insert(&Star{Uid: uid, RepoId: repoId}); err != nil {
|
||||
if _, err = x.Insert(&Star{UID: uid, RepoID: repoId}); err != nil {
|
||||
return err
|
||||
} else if _, err = x.Exec("UPDATE `repository` SET num_stars = num_stars + 1 WHERE id = ?", repoId); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue