diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/action.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/models/action.go b/models/action.go index 6a77d73003..93c1e2768f 100644 --- a/models/action.go +++ b/models/action.go @@ -43,7 +43,22 @@ func (a Action) GetRepoName() string { return a.RepoName } +func CommitRepoAction(userId int64, userName string, + repoId int64, repoName string, msg string) error { + _, err := orm.InsertOne(&Action{ + UserId: userId, + ActUserId: userId, + ActUserName: userName, + OpType: OP_COMMIT_REPO, + Content: msg, + RepoId: repoId, + RepoName: repoName, + }) + return err +} + // NewRepoAction inserts action for create repository. + func NewRepoAction(user *User, repo *Repository) error { _, err := orm.InsertOne(&Action{ UserId: user.Id, |