1
0
mirror of https://github.com/nextcloud/ocsms.git synced 2026-08-11 16:32:55 +00:00

Add query + routes to drop all user messages

This commit is contained in:
Loic Blot
2018-09-08 00:18:56 +02:00
committed by Loïc Blot
parent 615ba409e5
commit 267872b396
3 changed files with 22 additions and 2 deletions
+12 -2
View File
@@ -211,7 +211,7 @@ class SmsController extends Controller {
$this->smsMapper->removeMessagesForPhoneNumber($this->userId, $phnumber);
}
}
return new JSONResponse(array());
return new JSONResponse(array("status" => "ok"));
}
/**
@@ -263,6 +263,16 @@ class SmsController extends Controller {
return new JSONResponse(array(), Http::STATUS_BAD_REQUEST);
}
$this->smsMapper->removeMessage($this->userId, $phoneNumber, $messageId);
return new JSONResponse(array());
return new JSONResponse(array("status" => "ok"));
}
/**
* @NoAdminRequired
* @NoCSRFRequired
* @return JSONResponse
*/
public function wipeAllUserMessages () {
$this->smsMapper->removeAllMessagesForUser($this->userId);
return new JSONResponse(array("status" => "ok"));
}
}