FIX: draft not clearing when replying to new topic

This amends our API so we provide it with the draft key when saving a post
this means post creator can clean up the draft consistently even if we are
doing fancy stuff like replying to a new topic or new pm or whatever.

There will be some followup work to clean it up so client never calls destroy
on draft during normal operation and the #create/#update endpoints takes care of it
every time
This commit is contained in:
Sam Saffron
2019-11-26 18:23:10 +11:00
parent d0246104ee
commit 941162e90e
4 changed files with 21 additions and 6 deletions

View File

@ -671,7 +671,8 @@ class PostsController < ApplicationController
:auto_track,
:typing_duration_msecs,
:composer_open_duration_msecs,
:visible
:visible,
:draft_key
]
Post.plugin_permitted_create_params.each do |key, plugin|