aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_reminders/lib/Controller
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2023-07-31 12:10:50 -0700
committerChristopher Ng <chrng8@gmail.com>2023-08-03 15:30:11 -0700
commitbdf07413d02a23aa460aa821191325b04561d597 (patch)
treedb8b87c3a9d272b688969f516fac4552d566764c /apps/files_reminders/lib/Controller
parentd31302e72c8c6ec4281453e245b2e4a367b1c603 (diff)
downloadnextcloud-server-bdf07413d02a23aa460aa821191325b04561d597.tar.gz
nextcloud-server-bdf07413d02a23aa460aa821191325b04561d597.zip
enh: return created status code
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'apps/files_reminders/lib/Controller')
-rw-r--r--apps/files_reminders/lib/Controller/ApiController.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_reminders/lib/Controller/ApiController.php b/apps/files_reminders/lib/Controller/ApiController.php
index 30465f6a69b..fc1b647148d 100644
--- a/apps/files_reminders/lib/Controller/ApiController.php
+++ b/apps/files_reminders/lib/Controller/ApiController.php
@@ -94,7 +94,10 @@ class ApiController extends OCSController {
}
try {
- $this->reminderService->createOrUpdate($user, $fileId, $dueDate);
+ $created = $this->reminderService->createOrUpdate($user, $fileId, $dueDate);
+ if ($created) {
+ return new JSONResponse([], Http::STATUS_CREATED);
+ }
return new JSONResponse([], Http::STATUS_OK);
} catch (NodeNotFoundException $e) {
return new JSONResponse([], Http::STATUS_NOT_FOUND);