diff --git a/lib/use_case/question/create.rb b/lib/use_case/question/create.rb index 1904f6f6..7a5e0f56 100644 --- a/lib/use_case/question/create.rb +++ b/lib/use_case/question/create.rb @@ -32,8 +32,11 @@ module UseCase inbox = ::Inbox.create!(user: target_user, question: question, new: true) { - question: question, - inbox: inbox + status: 201, + resource: question, + extra: { + inbox: + } } end diff --git a/lib/use_case/question/create_followers.rb b/lib/use_case/question/create_followers.rb index 23695a74..cce75f76 100644 --- a/lib/use_case/question/create_followers.rb +++ b/lib/use_case/question/create_followers.rb @@ -23,7 +23,8 @@ module UseCase QuestionWorker.perform_async(source_user_id, question.id) { - question: question + status: 201, + resource: question } end diff --git a/lib/use_case/question/destroy.rb b/lib/use_case/question/destroy.rb index 5ffc8f54..e41043a1 100644 --- a/lib/use_case/question/destroy.rb +++ b/lib/use_case/question/destroy.rb @@ -15,6 +15,11 @@ module UseCase raise Errors::Forbidden unless current_user&.mod? || question.user == current_user question.destroy! + + { + status: 204, + resource: nil, + } end end end