Skip to content

Commit

Permalink
Merge pull request #9 from naoki1510/develop
Browse files Browse the repository at this point in the history
問題の追加フローを修正
  • Loading branch information
naoki1510 authored Mar 9, 2024
2 parents 3357ffa + 1302629 commit 2b4e147
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/app/models/question.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def status
private
def set_display_order
self.display_order ||= Question.maximum(:display_order).to_i + 1
if Question.where(display_order: self.display_order).where.not(id: self.id).exists?
Question.where(display_order: self.display_order).where.not(id: self.id).update_all("display_order = display_order + 1")
end
end

end
9 changes: 9 additions & 0 deletions client/src/components/questions/ShowQuestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ export default memo(function ShowQuestion() {
>
戻る
</Button>
<Button
as={Link}
to={locations.createQuestion}
colorScheme="teal"
ml={"auto"}
variant={"outline"}
>
問題を追加
</Button>
</HStack>
</VStack>
) : (
Expand Down

0 comments on commit 2b4e147

Please sign in to comment.