mirror of https://github.com/gogs/gogs.git
parent
8938855b40
commit
de3161155b
|
@ -89,7 +89,7 @@ func dumpTable(db *gorm.DB, table interface{}, w io.Writer) error {
|
||||||
return errors.Wrap(err, "encode JSON")
|
return errors.Wrap(err, "encode JSON")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return rows.Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
func dumpLegacyTables(dirPath string, verbose bool) error {
|
func dumpLegacyTables(dirPath string, verbose bool) error {
|
||||||
|
|
|
@ -355,6 +355,7 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||||
}, reqRepoWriter())
|
}, reqRepoWriter())
|
||||||
|
|
||||||
m.Patch("/issue-tracker", reqRepoWriter(), bind(api.EditIssueTrackerOption{}), repo.IssueTracker)
|
m.Patch("/issue-tracker", reqRepoWriter(), bind(api.EditIssueTrackerOption{}), repo.IssueTracker)
|
||||||
|
m.Patch("/wiki", reqRepoWriter(), bind(api.EditWikiOption{}), repo.Wiki)
|
||||||
m.Post("/mirror-sync", reqRepoWriter(), repo.MirrorSync)
|
m.Post("/mirror-sync", reqRepoWriter(), repo.MirrorSync)
|
||||||
m.Get("/editorconfig/:filename", context.RepoRef(), repo.GetEditorconfig)
|
m.Get("/editorconfig/:filename", context.RepoRef(), repo.GetEditorconfig)
|
||||||
}, repoAssignment())
|
}, repoAssignment())
|
||||||
|
|
|
@ -390,6 +390,32 @@ func IssueTracker(c *context.APIContext, form api.EditIssueTrackerOption) {
|
||||||
c.NoContent()
|
c.NoContent()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Wiki(c *context.APIContext, form api.EditWikiOption) {
|
||||||
|
_, repo := parseOwnerAndRepo(c)
|
||||||
|
if c.Written() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if form.AllowPublicWiki != nil {
|
||||||
|
repo.AllowPublicWiki = *form.AllowPublicWiki
|
||||||
|
}
|
||||||
|
if form.EnableExternalWiki != nil {
|
||||||
|
repo.EnableExternalWiki = *form.EnableExternalWiki
|
||||||
|
}
|
||||||
|
if form.EnableWiki != nil {
|
||||||
|
repo.EnableWiki = *form.EnableWiki
|
||||||
|
}
|
||||||
|
if form.ExternalWikiURL != nil {
|
||||||
|
repo.ExternalWikiURL = *form.ExternalWikiURL
|
||||||
|
}
|
||||||
|
if err := db.UpdateRepository(repo, false); err != nil {
|
||||||
|
c.Error(err, "update repository")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
c.NoContent()
|
||||||
|
}
|
||||||
|
|
||||||
func MirrorSync(c *context.APIContext) {
|
func MirrorSync(c *context.APIContext) {
|
||||||
_, repo := parseOwnerAndRepo(c)
|
_, repo := parseOwnerAndRepo(c)
|
||||||
if c.Written() {
|
if c.Written() {
|
||||||
|
|
Loading…
Reference in New Issue