Skip to content

Commit

Permalink
JB-16 : 모든 유저의 총 여행 수 반환하는 API 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
xi-jjun committed Aug 16, 2023
1 parent 96d07ad commit f041e28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/api/v1/journeys/journey_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ def journey_status_update
render json: { code: 200, message: 'success' }
end

def total_journey_count
render json: { code: 200, journey_count: Journey.all.count }
end

private

def already_traveling_or_preparing?
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
namespace :journeys do
controller 'journey' do
get '/current', to: 'journey#current_user_journey'
get '/count', to: 'journey#total_journey_count'
get '/:journey_id', to: 'journey#journey_detail'
post '/', to: 'journey#start_journey'
patch '/:journey_id', to: 'journey#update_journey'
Expand Down

0 comments on commit f041e28

Please sign in to comment.