diff options
Diffstat (limited to 'pages/api')
-rw-r--r-- | pages/api/fronter.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/pages/api/fronter.php b/pages/api/fronter.php index 9ef5571..9f70fdc 100644 --- a/pages/api/fronter.php +++ b/pages/api/fronter.php @@ -105,6 +105,21 @@ switch ($type) { break; + case "bottom": + if (!isset($index) || trim($index) === "" || !is_integer($index)) { + if ($index !== null) peh_error("Invalid index", 400); + } + + $day = $list[$date]; + + if (!isset($day[$index])) { + if ($index !== null) peh_error("Index not found", 404); + } + + moveElement($list[$date], $index, count($list[$date]) - 1); + + break; + case "up": if (!isset($index) || trim($index) === "" || !is_integer($index)) { if ($index !== null) peh_error("Invalid index", 400); @@ -120,6 +135,21 @@ switch ($type) { break; + case "top": + if (!isset($index) || trim($index) === "" || !is_integer($index)) { + if ($index !== null) peh_error("Invalid index", 400); + } + + $day = $list[$date]; + + if (!isset($day[$index])) { + if ($index !== null) peh_error("Index not found", 404); + } + + moveElement($list[$date], $index, 0); + + break; + default: peh_error("Invalid type name", 400); break; |