restrict possible period param values
This commit is contained in:
parent
84e9350676
commit
a2faa6b144
1 changed files with 1 additions and 1 deletions
2
app.rb
2
app.rb
|
@ -30,7 +30,7 @@ class LedgerRbApp < Sinatra::Base
|
|||
end
|
||||
|
||||
get '/api/ledger/register/:period/?' do
|
||||
param :period, String, required: true # TODO: restrict possible values to [ 'yearly', 'monthly' ]
|
||||
param :period, String, required: true, within: [ 'yearly', 'monthly' ]
|
||||
param :categories, Array, default: Ledger.accounts( 1 )
|
||||
|
||||
params[ :categories ].map do
|
||||
|
|
Loading…
Add table
Reference in a new issue