mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 14:29:53 +01:00
Return hashes from question use cases
This commit is contained in:
parent
a3e030bd10
commit
a8e99723cc
3 changed files with 12 additions and 3 deletions
|
@ -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 a new issue