mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:31:35 +08:00
FIX: Confirm draft_key
is present on GET
Also adds a test for the `show` action which did not exist
This commit is contained in:
@ -6,6 +6,8 @@ class DraftController < ApplicationController
|
||||
skip_before_action :check_xhr, :preload_json
|
||||
|
||||
def show
|
||||
raise Discourse::NotFound.new if params[:draft_key].blank?
|
||||
|
||||
seq = params[:sequence] || DraftSequence.current(current_user, params[:draft_key])
|
||||
render json: { draft: Draft.get(current_user, params[:draft_key], seq), draft_sequence: seq }
|
||||
end
|
||||
|
Reference in New Issue
Block a user