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 1... Línea 1...
1
<?php
1
<?php
2
 
-
 
3
/**
-
 
4
 * 
-
 
5
 * Controlador: Mis Perfiles 
-
 
6
 * 
-
 
7
 */
-
 
8
 
-
 
9
declare(strict_types=1);
2
declare(strict_types=1);
Línea 10... Línea 3...
10
 
3
 
Línea 11... Línea 4...
11
namespace LeadersLinked\Controller;
4
namespace LeadersLinked\Controller;
Línea 868... Línea 861...
868
    }
861
    }
Línea 869... Línea 862...
869
 
862
 
870
    public function saveReactionAction()
863
    public function saveReactionAction()
871
    {
864
    {
872
        $id = $this->params()->fromRoute('id');
865
        $id = $this->params()->fromRoute('id');
-
 
866
       // $reaction  = $this->params()->fromRoute('reaction');
Línea 873... Línea 867...
873
        $reaction  = $this->params()->fromRoute('reaction');
867
        $reaction  = $this->params()->fromPost('reaction');
874
 
868
 
875
        $request = $this->getRequest();
869
        $request = $this->getRequest();
876
        if ($request->isPost()) {
870
        if ($request->isPost()) {
Línea 885... Línea 879...
885
                    'success' => false,
879
                    'success' => false,
886
                    'data' => 'ERROR_POST_NOT_FOUND'
880
                    'data' => 'ERROR_POST_NOT_FOUND'
887
                ];
881
                ];
888
                return new JsonModel($response);
882
                return new JsonModel($response);
889
            }
883
            }
-
 
884
            
-
 
885
            $reactions = [
-
 
886
                ContentReaction::REACTION_RECOMMENDED,
-
 
887
                ContentReaction::REACTION_SUPPORT,
-
 
888
                ContentReaction::REACTION_LOVE,
-
 
889
                ContentReaction::REACTION_INTEREST,
-
 
890
                ContentReaction::REACTION_FUN
-
 
891
                
-
 
892
            ];
-
 
893
            if(in_array($reaction, $reactions)) {
-
 
894
                $response = [
-
 
895
                    'success' => false,
-
 
896
                    'data' => 'ERROR_REACTION_NOT_FOUND'
-
 
897
                ];
-
 
898
                return new JsonModel($response);
-
 
899
            }
-
 
900
            
-
 
901
            
890
            $contentReactionMapper = ContentReactionMapper::getInstance($this->adapter);
902
            $contentReactionMapper = ContentReactionMapper::getInstance($this->adapter);
891
            $contentReaction = $contentReactionMapper->fetchOneByFeedIdAndUserId($feed->id, $currentUser->id);
903
            $contentReaction = $contentReactionMapper->fetchOneByFeedIdAndUserId($feed->id, $currentUser->id);
Línea 892... Línea 904...
892
 
904
 
893
            if ($contentReaction) {
905
            if ($contentReaction) {