summaryrefslogtreecommitdiff
path: root/system/api/external.go
diff options
context:
space:
mode:
Diffstat (limited to 'system/api/external.go')
-rw-r--r--system/api/external.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/system/api/external.go b/system/api/external.go
index 0da7eac..a65618b 100644
--- a/system/api/external.go
+++ b/system/api/external.go
@@ -8,12 +8,21 @@ import (
"github.com/bosssauce/ponzu/system/db"
)
-// Externalable accepts or rejects external POST requests to /external/posts?type=Review
+// Externalable accepts or rejects external POST requests to endpoints such as:
+// /external/posts?type=Review
type Externalable interface {
// Accepts determines whether a type will allow external submissions
Accepts() bool
}
+// Mergeable allows external post content to be approved and published through
+// the public-facing API
+type Mergeable interface {
+ // Approve copies an external post to the internal collection and triggers
+ // a re-sort of its content type posts
+ Approve() error
+}
+
func externalPostsHandler(res http.ResponseWriter, req *http.Request) {
if req.Method != http.MethodPost {
res.WriteHeader(http.StatusMethodNotAllowed)