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

View file

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

View file

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

View file

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