Add management of webmentions

This commit is contained in:
2024-01-26 11:43:19 +11:00
parent 9dad3d88ce
commit fa031d880b
10 changed files with 110 additions and 4 deletions

View File

@@ -0,0 +1,12 @@
# frozen_string_literal: true
module Admin
module Actions
module Webmentions
class Index < Admin::Action
def handle(request, response)
end
end
end
end
end

View File

@@ -0,0 +1,25 @@
# frozen_string_literal: true
module Admin
module Actions
module Webmentions
class Update < Admin::Action
include Deps["repos.webmention_repo"]
def handle(req, resp)
update_type = req.params[:update_type]
if update_type == "archive"
webmention_repo.update(req.params[:id], published_at: nil)
end
if update_type == "publish"
webmention_repo.update(req.params[:id], published_at: Time.now)
end
resp.headers["HX-Refresh"] = true
resp.status = 200
end
end
end
end
end