mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 11:25:29 -04:00
Simplify subscription JSON parsing
This commit is contained in:
parent
ae1c36263b
commit
238860d52d
@ -341,7 +341,7 @@ const component = () => {
|
||||
fetch(`${base_url}api/admin/plugin/subscribe`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
filters: JSON.stringify(this.filterSettings),
|
||||
filters: this.filterSettings,
|
||||
plugin: this.pid,
|
||||
name: this.subscriptionName.trim()
|
||||
}),
|
||||
|
@ -587,7 +587,7 @@ struct APIRouter
|
||||
post "/api/admin/plugin/subscribe" do |env|
|
||||
begin
|
||||
plugin_id = env.params.json["plugin"].as String
|
||||
filters = JSON.parse(env.params.json["filters"].to_s).as_a.map do |f|
|
||||
filters = env.params.json["filters"].as(Array(JSON::Any)).map do |f|
|
||||
Filter.from_json f.to_json
|
||||
end
|
||||
name = env.params.json["name"].as String
|
||||
|
Loading…
x
Reference in New Issue
Block a user