Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c83b71853b | |||
| 8bc3165995 | |||
| dffcf66ce3 |
@@ -226,7 +226,7 @@ class AnswerController extends FOSRestController
|
||||
throw new ResourceValidationException($message, $status);
|
||||
}
|
||||
|
||||
if (!isset($messageText)) {
|
||||
if (empty($messageText)) {
|
||||
$message = 'Le message est vide.';
|
||||
$status = 'failure';
|
||||
throw new ResourceValidationException($message, $status);
|
||||
@@ -235,7 +235,7 @@ class AnswerController extends FOSRestController
|
||||
$answerReceipiant = $existAnswer->getAd() !== null ? $existAnswer->getAd()->getCreator()
|
||||
: $existAnswer->getCompany()->getUsers(){ 0 };
|
||||
|
||||
$message = new message('Chat', $messageText, $this->getUser(), $answerReceipiant, 'CHAT', $existAnswer);
|
||||
$message = new message('Chat', $messageText, $this->getUser(), $answerReceipiant, 'Message du talent', $existAnswer);
|
||||
$em->persist($message);
|
||||
$em->flush();
|
||||
|
||||
|
||||
@@ -186,7 +186,9 @@ class CompanyController extends Controller
|
||||
} else {
|
||||
$history->recordIt("Anonymous", "r", 'AppBundle\Entity\Company', $company->getId(), serialize($company));
|
||||
}
|
||||
if($this->getUser()->getUsername()){
|
||||
|
||||
|
||||
if(!$this->getUser() == null){
|
||||
return new JsonResponse(array('code' => "ok", "user" => $this->getUser()->getUsername()));
|
||||
} else{
|
||||
return new JsonResponse(array('code' => "ok"));
|
||||
|
||||
@@ -177,7 +177,7 @@ class Answer
|
||||
$criteria = Criteria::create()
|
||||
->where(Criteria::expr()->neq('status', "DRAFT"));
|
||||
|
||||
return $this->messages->matching($criteria)->last();
|
||||
return $this->messages->matching($criteria)->first();
|
||||
}
|
||||
|
||||
public function getIsViewed(){
|
||||
|
||||
Reference in New Issue
Block a user