mirror of
https://github.com/nextcloud/ocsms.git
synced 2026-08-23 14:22:54 +00:00
Use JSONResponse
This commit is contained in:
@@ -13,8 +13,8 @@ namespace OCA\OcSms\Controller;
|
|||||||
|
|
||||||
|
|
||||||
use \OCP\IRequest;
|
use \OCP\IRequest;
|
||||||
use \OCP\AppFramework\Http\TemplateResponse;
|
|
||||||
use \OCP\AppFramework\Controller;
|
use \OCP\AppFramework\Controller;
|
||||||
|
use \OCP\AppFramework\Http\JSONResponse;
|
||||||
use \OCA\OcSms\Db\SmsMapper;
|
use \OCA\OcSms\Db\SmsMapper;
|
||||||
|
|
||||||
class SmsController extends Controller {
|
class SmsController extends Controller {
|
||||||
@@ -44,11 +44,11 @@ class SmsController extends Controller {
|
|||||||
*/
|
*/
|
||||||
public function push ($smsCount, $smsDatas) {
|
public function push ($smsCount, $smsDatas) {
|
||||||
if ($this->checkPushStructure($smsCount, $smsDatas) === false) {
|
if ($this->checkPushStructure($smsCount, $smsDatas) === false) {
|
||||||
return array("status" => false, "msg" => $this->errorMsg);
|
return new JSONResponse(array("status" => false, "msg" => $this->errorMsg));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->smsMapper->saveAll($this->userId, $smsDatas);
|
$this->smsMapper->saveAll($this->userId, $smsDatas);
|
||||||
return array("status" => true, "msg" => "OK");
|
return new JSONResponse(array("status" => true, "msg" => "OK"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function checkPushStructure($smsCount, $smsDatas) {
|
private function checkPushStructure($smsCount, $smsDatas) {
|
||||||
|
|||||||
Reference in New Issue
Block a user