Move remaining routes to new structure

This commit is contained in:
matthewmcgarvey
2022-02-22 23:20:09 -06:00
parent cc59de0c93
commit 3b1837a99b
4 changed files with 44 additions and 44 deletions

View File

@@ -397,4 +397,22 @@ module Invidious::Routes::API::V1::Authenticated
env.response.status_code = 204
end
def self.notifications_get(env)
env.response.content_type = "text/event-stream"
topics = env.params.query["topics"]?.try &.split(",").uniq.first(1000)
topics ||= [] of String
create_notification_stream(env, topics, CONNECTION_CHANNEL)
end
def self.notifications_post(env)
env.response.content_type = "text/event-stream"
topics = env.params.body["topics"]?.try &.split(",").uniq.first(1000)
topics ||= [] of String
create_notification_stream(env, topics, CONNECTION_CHANNEL)
end
end