Update repo model

This commit is contained in:
2015-03-20 18:43:58 +07:00
parent 6e498953bd
commit f01da56147
2 changed files with 29 additions and 17 deletions
+9 -2
View File
@@ -20,9 +20,16 @@ func SyncRepos(token, owner string) {
panic(err)
}
for _, repo := range repos {
var descr string
if repo.Description != nil {
descr = *repo.Description
}
r := &db.Repo{
Owner: owner,
Name: *repo.Name,
OrgID: uint64(*repo.Organization.ID),
Name: *repo.Name,
Description: descr,
IsPrivate: *repo.Private,
IsFork: *repo.Fork,
}
r.Save()
}