enh: does not exist return null

Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
Christopher Ng 2023-07-31 12:10:50 -07:00
parent db7f5a29f3
commit 9bd7ddd074

View file

@ -68,7 +68,10 @@ class ApiController extends OCSController {
];
return new JSONResponse($reminderData, Http::STATUS_OK);
} catch (DoesNotExistException $e) {
return new JSONResponse([], Http::STATUS_NOT_FOUND);
$reminderData = [
'dueDate' => null,
];
return new JSONResponse($reminderData, Http::STATUS_OK);
} catch (Throwable $th) {
$this->logger->error($th->getMessage(), ['exception' => $th]);
return new JSONResponse([], Http::STATUS_INTERNAL_SERVER_ERROR);