upd: api.message (DELETE message/emergency)
This commit is contained in:
parent
512bd699de
commit
11761e16e2
|
@ -89,19 +89,31 @@ class message
|
|||
public function DELETE_emergency($argv){
|
||||
extract($argv);
|
||||
|
||||
/* (1) Create emergenct
|
||||
---------------------------------------------------------*/
|
||||
/* (1) Try to create entry */
|
||||
$deleted = Repo::request('emergency', 'remove', $id);
|
||||
|
||||
/* (2) If cannot create -> dispatch error */
|
||||
if( $deleted === false )
|
||||
return ['error' => new Error(Err::RepoError)];
|
||||
|
||||
|
||||
|
||||
/* (2) Send to WebSocket
|
||||
---------------------------------------------------------*/
|
||||
$wsi = new wsinterop("localhost",9998);
|
||||
|
||||
$wsi->send([
|
||||
"operation" => "DelMessage",
|
||||
"id" => $id,
|
||||
"channelType" => "Emergency",
|
||||
"channelName" => is_null($URL_0) ? "" : "$URL_0"
|
||||
'operation' => 'DelMessage',
|
||||
'id' => $id,
|
||||
'channelType' => 'Emergency',
|
||||
'channelName' => "$URL_0"
|
||||
]);
|
||||
|
||||
$wsi->close();
|
||||
|
||||
return ["sent" => true];
|
||||
//TODO: tout poster dans la BDD
|
||||
return ["deleted" => true];
|
||||
}
|
||||
|
||||
public function PUT_emergency($argv){
|
||||
|
|
Loading…
Reference in New Issue