Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 6866 | Rev 7095 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 6866 Rev 7094
Línea 475... Línea 475...
475
    }*/
475
    }*/
Línea 476... Línea 476...
476
    
476
    
477
    public function saveReactionAction()
477
    public function saveReactionAction()
478
    {
478
    {
479
        $id = $this->params()->fromRoute('id');
479
        $id = $this->params()->fromRoute('id');
Línea 480... Línea 480...
480
        $reaction  = $this->params()->fromRoute('reaction');
480
        $reaction  = $this->params()->fromPost('reaction');
481
        
481
        
482
        $request = $this->getRequest();
482
        $request = $this->getRequest();
483
        if ($request->isPost()) {
483
        if ($request->isPost()) {
Línea 493... Línea 493...
493
                    'data' => 'ERROR_POST_NOT_FOUND'
493
                    'data' => 'ERROR_POST_NOT_FOUND'
494
                ];
494
                ];
495
                return new JsonModel($response);
495
                return new JsonModel($response);
496
            }
496
            }
Línea -... Línea 497...
-
 
497
            
-
 
498
            $reactions = [
-
 
499
                ContentReaction::REACTION_RECOMMENDED, 
-
 
500
                ContentReaction::REACTION_SUPPORT,
-
 
501
                ContentReaction::REACTION_LOVE, 
-
 
502
                ContentReaction::REACTION_INTEREST, 
-
 
503
                ContentReaction::REACTION_FUN
-
 
504
                
-
 
505
            ];
-
 
506
            if(in_array($reaction, $reactions)) {
-
 
507
                $response = [
-
 
508
                    'success' => false,
-
 
509
                    'data' => 'ERROR_REACTION_NOT_FOUND'
-
 
510
                ];
-
 
511
                return new JsonModel($response);
-
 
512
            }
-
 
513
 
-
 
514
            
-
 
515
            
-
 
516
            
497
            
517
            
498
            $contentReactionMapper = ContentReactionMapper::getInstance($this->adapter);
518
            $contentReactionMapper = ContentReactionMapper::getInstance($this->adapter);
Línea 499... Línea 519...
499
            $contentReaction = $contentReactionMapper->fetchOneByPostIdAndUserId($post->id, $currentUser->id);
519
            $contentReaction = $contentReactionMapper->fetchOneByPostIdAndUserId($post->id, $currentUser->id);
500
            
520