Rename base_url to collection_url in MD API
Ref T519
This commit is contained in:
parent
a4579719cd
commit
9fb8de48d4
1 changed files with 5 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright © 2018 A Bunch Tell LLC.
|
* Copyright © 2018-2020 A Bunch Tell LLC.
|
||||||
*
|
*
|
||||||
* This file is part of WriteFreely.
|
* This file is part of WriteFreely.
|
||||||
*
|
*
|
||||||
|
@ -245,11 +245,9 @@ func handleRenderMarkdown(app *App, w http.ResponseWriter, r *http.Request) erro
|
||||||
}
|
}
|
||||||
|
|
||||||
in := struct {
|
in := struct {
|
||||||
BaseURL string `json:"base_url"`
|
CollectionURL string `json:"collection_url"`
|
||||||
RawBody string `json:"raw_body"`
|
RawBody string `json:"raw_body"`
|
||||||
}{
|
}{}
|
||||||
BaseURL: "",
|
|
||||||
}
|
|
||||||
|
|
||||||
decoder := json.NewDecoder(r.Body)
|
decoder := json.NewDecoder(r.Body)
|
||||||
err := decoder.Decode(&in)
|
err := decoder.Decode(&in)
|
||||||
|
@ -261,7 +259,7 @@ func handleRenderMarkdown(app *App, w http.ResponseWriter, r *http.Request) erro
|
||||||
out := struct {
|
out := struct {
|
||||||
Body string `json:"body"`
|
Body string `json:"body"`
|
||||||
}{
|
}{
|
||||||
Body: applyMarkdown([]byte(in.RawBody), in.BaseURL, app.cfg),
|
Body: applyMarkdown([]byte(in.RawBody), in.CollectionURL, app.cfg),
|
||||||
}
|
}
|
||||||
|
|
||||||
return impart.WriteSuccess(w, out, http.StatusOK)
|
return impart.WriteSuccess(w, out, http.StatusOK)
|
||||||
|
|
Loading…
Add table
Reference in a new issue