mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-20 00:35:22 +00:00
feat: add streaks to user stats endpoint (#891)
* add api to streaks * swaggerize
This commit is contained in:
parent
f8034f87db
commit
8edd8404d2
3 changed files with 8 additions and 2 deletions
|
|
@ -126,7 +126,8 @@ class Api::V1::StatsController < ApplicationController
|
|||
|
||||
render json: {
|
||||
data: summary,
|
||||
trust_factor: trust_info
|
||||
trust_factor: trust_info,
|
||||
streak: @user.streak_days
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -249,7 +249,8 @@ RSpec.describe 'Api::V1::Stats', type: :request do
|
|||
trust_level: { type: :string, example: 'blue' },
|
||||
trust_value: { type: :integer, example: 3 }
|
||||
}
|
||||
}
|
||||
},
|
||||
streak: { type: :integer, example: 7, description: 'Number of consecutive days the user has coded' }
|
||||
}
|
||||
run_test!
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3140,6 +3140,10 @@ paths:
|
|||
trust_value:
|
||||
type: integer
|
||||
example: 3
|
||||
streak:
|
||||
type: integer
|
||||
example: 7
|
||||
description: Number of consecutive days the user has coded
|
||||
'403':
|
||||
description: forbidden
|
||||
content:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue