Return hashes from question use cases
This commit is contained in:
parent
a3e030bd10
commit
a8e99723cc
|
@ -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
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ module UseCase
|
|||
QuestionWorker.perform_async(source_user_id, question.id)
|
||||
|
||||
{
|
||||
question: question
|
||||
status: 201,
|
||||
resource: question
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue