mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-20 11:58:48 +00:00
Combine notifications endpoints and move them
This commit is contained in:
@@ -398,19 +398,11 @@ module Invidious::Routes::API::V1::Authenticated
|
||||
env.response.status_code = 204
|
||||
end
|
||||
|
||||
def self.notifications_get(env)
|
||||
def self.notifications(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)
|
||||
raw_topics = env.params.body["topics"]? || env.params.query["topics"]?
|
||||
topics = raw_topics.try &.split(",").uniq.first(1000)
|
||||
topics ||= [] of String
|
||||
|
||||
create_notification_stream(env, topics, CONNECTION_CHANNEL)
|
||||
|
||||
Reference in New Issue
Block a user