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.
This commit is contained in:
evazion
2021-12-08 23:22:56 -06:00
parent fd127cbaba
commit 16216070e0

View File

@@ -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();