Shauny
(Shaun Robinson)
Mars 27, 2024, 3:54
1
J’ai déjà configuré le “suivi” sur mon site (en utilisant WordPress et Ultimate Member), existe-t-il une API pour cela afin que je puisse intégrer les deux ?
Vous pourrez probablement vous en sortir à partir de là (en cas de doute, regardez toujours le code source ! ) :
enabled_site_setting :discourse_follow_enabled
register_asset "stylesheets/common/follow.scss"
register_svg_icon "discourse-follow-new-reply"
register_svg_icon "discourse-follow-new-follower"
register_svg_icon "discourse-follow-new-topic"
load File.expand_path("../lib/follow/engine.rb", __FILE__)
Discourse::Application.routes.append do
mount ::Follow::Engine, at: "follow"
%w[users u].each_with_index do |root_path, index|
get "#{root_path}/:username/follow" => "follow/follow#index",
:constraints => {
username: RouteFormat.username,
}
get "#{root_path}/:username/follow/feed" => "follow/follow#index",
:constraints => {
username: RouteFormat.username,
}
(au fait, ce “follow” devrait-il être un GET ?! Mais à ce sujet, débat amusant ici )