mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: map numeric spec enum keys
This commit is contained in:
@@ -32,7 +32,13 @@ Http::get('/v1/project/usage')
|
||||
))
|
||||
->param('startDate', '', new DateTimeValidator(), 'Starting date for the usage')
|
||||
->param('endDate', '', new DateTimeValidator(), 'End date for the usage')
|
||||
->param('period', '1d', new WhiteList(['1h', '1d']), 'Period used', true, enum: new Enum(name: 'ProjectUsageRange'))
|
||||
->param('period', '1d', new WhiteList(['1h', '1d']), 'Period used', true, enum: new Enum(
|
||||
name: 'ProjectUsageRange',
|
||||
map: [
|
||||
'1h' => 'OneHour',
|
||||
'1d' => 'OneDay',
|
||||
]
|
||||
))
|
||||
->inject('response')
|
||||
->inject('project')
|
||||
->inject('dbForProject')
|
||||
|
||||
@@ -67,7 +67,15 @@ class Create extends Action
|
||||
->label('abuse-time', 60)
|
||||
->param('domain', null, new ValidatorDomain(), 'Domain name.')
|
||||
->param('url', null, new URL(), 'Target URL of redirection')
|
||||
->param('statusCode', null, new WhiteList([301, 302, 307, 308]), 'Status code of redirection', enum: new Enum(name: 'RedirectStatusCode'))
|
||||
->param('statusCode', null, new WhiteList([301, 302, 307, 308]), 'Status code of redirection', enum: new Enum(
|
||||
name: 'RedirectStatusCode',
|
||||
map: [
|
||||
'301' => 'MovedPermanently',
|
||||
'302' => 'Found',
|
||||
'307' => 'TemporaryRedirect',
|
||||
'308' => 'PermanentRedirect',
|
||||
]
|
||||
))
|
||||
->param('resourceId', '', fn (Database $dbForProject) => new UID($dbForProject->getAdapter()->getMaxUIDLength()), 'ID of parent resource.', false, ['dbForProject'])
|
||||
->param('resourceType', '', new WhiteList(['site', 'function']), 'Type of parent resource.', enum: new Enum(
|
||||
name: 'ProxyResourceType',
|
||||
|
||||
Reference in New Issue
Block a user