mirror of https://github.com/jlelse/GoBlog
Add visibility options to micropub config query
This commit is contained in:
parent
3643f09b7b
commit
7dbaf9fadb
|
@ -40,6 +40,7 @@ func (a *goBlog) serveMicropubQuery(w http.ResponseWriter, r *http.Request) {
|
||||||
result = map[string]any{
|
result = map[string]any{
|
||||||
"channels": channels,
|
"channels": channels,
|
||||||
"media-endpoint": a.getFullAddress(micropubPath + micropubMediaSubPath),
|
"media-endpoint": a.getFullAddress(micropubPath + micropubMediaSubPath),
|
||||||
|
"visibility": []postVisibility{visibilityPublic, visibilityUnlisted, visibilityPrivate},
|
||||||
}
|
}
|
||||||
case "source":
|
case "source":
|
||||||
if urlString := query.Get("url"); urlString != "" {
|
if urlString := query.Get("url"); urlString != "" {
|
||||||
|
|
|
@ -39,7 +39,7 @@ func Test_micropubQuery(t *testing.T) {
|
||||||
testCases := []testCase{
|
testCases := []testCase{
|
||||||
{
|
{
|
||||||
query: "config",
|
query: "config",
|
||||||
want: "{\"channels\":[{\"name\":\"default: My Blog\",\"uid\":\"default\"},{\"name\":\"default/posts: posts\",\"uid\":\"default/posts\"}],\"media-endpoint\":\"http://localhost:8080/micropub/media\"}",
|
want: "{\"channels\":[{\"name\":\"default: My Blog\",\"uid\":\"default\"},{\"name\":\"default/posts: posts\",\"uid\":\"default/posts\"}],\"media-endpoint\":\"http://localhost:8080/micropub/media\",\"visibility\":[\"public\",\"unlisted\",\"private\"]}",
|
||||||
wantStatus: http.StatusOK,
|
wantStatus: http.StatusOK,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue