mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 16:29:52 +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)
|
inbox = ::Inbox.create!(user: target_user, question: question, new: true)
|
||||||
|
|
||||||
{
|
{
|
||||||
question: question,
|
status: 201,
|
||||||
inbox: inbox
|
resource: question,
|
||||||
|
extra: {
|
||||||
|
inbox:
|
||||||
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,8 @@ module UseCase
|
||||||
QuestionWorker.perform_async(source_user_id, question.id)
|
QuestionWorker.perform_async(source_user_id, question.id)
|
||||||
|
|
||||||
{
|
{
|
||||||
question: question
|
status: 201,
|
||||||
|
resource: question
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,11 @@ module UseCase
|
||||||
raise Errors::Forbidden unless current_user&.mod? || question.user == current_user
|
raise Errors::Forbidden unless current_user&.mod? || question.user == current_user
|
||||||
|
|
||||||
question.destroy!
|
question.destroy!
|
||||||
|
|
||||||
|
{
|
||||||
|
status: 204,
|
||||||
|
resource: nil,
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue