Added timezone support to the API when managing users (#952).

This commit is contained in:
Alex Tselegidis 2020-12-11 12:49:27 +02:00
parent 88b96f53cc
commit 039f3ec993
4 changed files with 24 additions and 0 deletions

View file

@ -40,6 +40,7 @@ class Admins implements ParsersInterface {
'state' => $response['state'], 'state' => $response['state'],
'zip' => $response['zip_code'], 'zip' => $response['zip_code'],
'notes' => $response['notes'], 'notes' => $response['notes'],
'timezone' => $response['timezone'],
'settings' => [ 'settings' => [
'username' => $response['settings']['username'], 'username' => $response['settings']['username'],
'notifications' => filter_var($response['settings']['notifications'], FILTER_VALIDATE_BOOLEAN), 'notifications' => filter_var($response['settings']['notifications'], FILTER_VALIDATE_BOOLEAN),
@ -115,6 +116,11 @@ class Admins implements ParsersInterface {
$decoded_request['notes'] = $request['notes']; $decoded_request['notes'] = $request['notes'];
} }
if ( ! empty($request['timezone']))
{
$decoded_request['timezone'] = $request['timezone'];
}
if ( ! empty($request['settings'])) if ( ! empty($request['settings']))
{ {
if (empty($decoded_request['settings'])) if (empty($decoded_request['settings']))

View file

@ -40,6 +40,7 @@ class Providers implements ParsersInterface {
'state' => $response['state'], 'state' => $response['state'],
'zip' => $response['zip_code'], 'zip' => $response['zip_code'],
'notes' => $response['notes'], 'notes' => $response['notes'],
'timezone' => $response['timezone'],
]; ];
if (array_key_exists('services', $response)) if (array_key_exists('services', $response))
@ -131,6 +132,11 @@ class Providers implements ParsersInterface {
$decoded_request['notes'] = $request['notes']; $decoded_request['notes'] = $request['notes'];
} }
if ( ! empty($request['timezone']))
{
$decoded_request['timezone'] = $request['timezone'];
}
if ( ! empty($request['services'])) if ( ! empty($request['services']))
{ {
$decoded_request['services'] = $request['services']; $decoded_request['services'] = $request['services'];

View file

@ -41,6 +41,7 @@ class Secretaries implements ParsersInterface {
'zip' => $response['zip_code'], 'zip' => $response['zip_code'],
'notes' => $response['notes'], 'notes' => $response['notes'],
'providers' => $response['providers'], 'providers' => $response['providers'],
'timezone' => $response['timezone'],
'settings' => [ 'settings' => [
'username' => $response['settings']['username'], 'username' => $response['settings']['username'],
'notifications' => filter_var($response['settings']['notifications'], FILTER_VALIDATE_BOOLEAN), 'notifications' => filter_var($response['settings']['notifications'], FILTER_VALIDATE_BOOLEAN),
@ -116,6 +117,11 @@ class Secretaries implements ParsersInterface {
$decoded_request['notes'] = $request['notes']; $decoded_request['notes'] = $request['notes'];
} }
if ( ! empty($request['timezone']))
{
$decoded_request['timezone'] = $request['timezone'];
}
if ( ! empty($request['providers'])) if ( ! empty($request['providers']))
{ {
$decoded_request['providers'] = $request['providers']; $decoded_request['providers'] = $request['providers'];

View file

@ -977,6 +977,8 @@ definitions:
type: string type: string
notes: notes:
type: string type: string
timezone:
type: string
settings: settings:
type: object type: object
properties: properties:
@ -1012,6 +1014,8 @@ definitions:
type: string type: string
notes: notes:
type: string type: string
timezone:
type: string
services: services:
type: array type: array
items: items:
@ -1063,6 +1067,8 @@ definitions:
type: string type: string
notes: notes:
type: string type: string
timezone:
type: string
providers: providers:
type: array type: array
items: items: