forked from Gitlink/gitea-1120-rc1
fix:wiki
This commit is contained in:
parent
6f2fdf1159
commit
925a7b18cb
|
@ -7,8 +7,7 @@
|
|||
package structs
|
||||
|
||||
type WikiesResponse struct {
|
||||
RepoName string `json:"repo_name"`
|
||||
OwnerName string `json:"owner_name"`
|
||||
|
||||
WikiMeta
|
||||
WikiCloneLink CloneLink `json:"wiki_clone_link"`
|
||||
}
|
||||
|
@ -33,6 +32,8 @@ type WikiUser struct {
|
|||
}
|
||||
|
||||
type WikiResponse struct {
|
||||
RepoName string `json:"repo_name"`
|
||||
OwnerName string `json:"owner_name"`
|
||||
WikiMeta
|
||||
CommitCounts int64 `json:"commit_counts"`
|
||||
MdContent string `json:"md_content"`
|
||||
|
|
|
@ -38,8 +38,6 @@ func WikiList(ctx *context.APIContext) {
|
|||
ctx.CheckHasWiki()
|
||||
return
|
||||
}
|
||||
OwnerName := ctx.Repo.Repository.OwnerName
|
||||
RepoName := ctx.Repo.Repository.Name
|
||||
|
||||
repository := ctx.Repo.Repository
|
||||
wikiCloneLink := repository.CloneWikiLink()
|
||||
|
@ -84,8 +82,7 @@ func WikiList(ctx *context.APIContext) {
|
|||
return
|
||||
}
|
||||
wikiesList = append(wikiesList, api.WikiesResponse{
|
||||
OwnerName: OwnerName,
|
||||
RepoName: RepoName,
|
||||
|
||||
WikiCloneLink: api.CloneLink{
|
||||
HTTPS: wikiCloneLink.HTTPS,
|
||||
SSH: wikiCloneLink.SSH,
|
||||
|
@ -229,6 +226,9 @@ func CreateWiki(ctx *context.APIContext, form api.WikiOption) {
|
|||
ctx.FileNameError()
|
||||
return
|
||||
}
|
||||
OwnerName := ctx.Repo.Repository.OwnerName
|
||||
RepoName := ctx.Repo.Repository.Name
|
||||
|
||||
repository := ctx.Repo.Repository
|
||||
wikiCloneLink := repository.CloneWikiLink()
|
||||
wikies.NewWikiPost(ctx, form)
|
||||
|
@ -245,6 +245,8 @@ func CreateWiki(ctx *context.APIContext, form api.WikiOption) {
|
|||
}
|
||||
}
|
||||
wiki := api.WikiResponse{
|
||||
OwnerName: OwnerName,
|
||||
RepoName: RepoName,
|
||||
WikiCloneLink: api.CloneLink{
|
||||
HTTPS: wikiCloneLink.HTTPS,
|
||||
SSH: wikiCloneLink.SSH,
|
||||
|
@ -312,6 +314,8 @@ func EditWiki(ctx *context.APIContext, form api.WikiOption) {
|
|||
|
||||
wikies.EditWikiPost(ctx, form)
|
||||
|
||||
OwnerName := ctx.Repo.Repository.OwnerName
|
||||
RepoName := ctx.Repo.Repository.Name
|
||||
|
||||
wikiRepo, commit, _ := wikies.FindWikiRepoCommit(ctx)
|
||||
data, entry, pageFilename, _ := wikies.WikiContentsByName(ctx, commit, form.Name) //
|
||||
|
@ -325,6 +329,8 @@ func EditWiki(ctx *context.APIContext, form api.WikiOption) {
|
|||
}
|
||||
}
|
||||
wiki := api.WikiResponse{
|
||||
OwnerName: OwnerName,
|
||||
RepoName: RepoName,
|
||||
WikiMeta: api.WikiMeta{
|
||||
Name: form.Name,
|
||||
Commit: api.WikiCommit{
|
||||
|
|
Loading…
Reference in New Issue