From 16216070e02d9f325c09877ea7fe922e097918af Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 8 Dec 2021 23:22:56 -0600 Subject: [PATCH] posts: fix tag scripts not working. If the `size` URL param wasn't present, then `size=null` would be passed to `/posts/:id.js`, which would fail because `null` wasn't a valid size. Regression in 8841de68ac. --- app/javascript/src/javascripts/posts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/src/javascripts/posts.js b/app/javascript/src/javascripts/posts.js index 7014f58f2..5eafeb1a4 100644 --- a/app/javascript/src/javascripts/posts.js +++ b/app/javascript/src/javascripts/posts.js @@ -413,7 +413,7 @@ Post.update = async function(post_id, mode, params) { let view = urlParams.get("view"); let size = urlParams.get("size"); - await $.ajax({ type: "PUT", url: `/posts/${post_id}.js?mode=${mode}&view=${view}&size=${size}`, data: params }); + await $.ajax({ type: "PUT", url: `/posts/${post_id}.js`, data: { mode, view, size, ...params }}); Post.pending_update_count -= 1; Post.show_pending_update_notice();