Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 11018 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11018 Rev 11019
Línea 388... Línea 388...
388
            ];
388
            ];
Línea 389... Línea 389...
389
 
389
 
390
            return new JsonModel($data);
390
            return new JsonModel($data);
Línea 391... Línea 391...
391
        }
391
        }
392
 
392
 
393
        $questionsMapper = MyTrainerQuestionsMapper::getInstance($this->adapter);
393
        $feedMapper = FeedMapper::getInstance($this->adapter);
394
        $questions = $questionsMapper->fetchOneByUuid($uuid);
394
        $feed = $feedMapper->fetchOneByUuid($uuid);
395
        if (!$questions) {
395
        if (!$feed) {
396
            $data = [
396
            $data = [
397
                'success' => false,
397
                'success' => false,
Línea 398... Línea 398...
398
                'data' => 'ERROR_RECORD_NOT_FOUND'
398
                'data' => 'ERROR_RECORD_NOT_FOUND'
399
            ];
399
            ];
Línea 400... Línea 400...
400
 
400
 
401
            return new JsonModel($data);
401
            return new JsonModel($data);
402
        }
402
        }
403
 
403
 
404
        if ($questions->company_id != $currentCompany->id) {
404
        if ($feed->company_id != $currentCompany->id) {
405
            return new JsonModel([
405
            return new JsonModel([
Línea 406... Línea 406...
406
                'success' => false,
406
                'success' => false,
Línea 407... Línea 407...
407
                'data' => 'ERROR_UNAUTHORIZED'
407
                'data' => 'ERROR_UNAUTHORIZED'
408
            ]);
408
            ]);
409
        }
409
        }
Línea 410... Línea 410...
410
 
410
 
411
        if ($request->isPost()) {
411
        if ($request->isPost()) {
412
 
412
 
413
 
413
 
414
            $result = $questionsMapper->delete($questions->id);
414
            $result = $feedMapper->delete($feed->id);
Línea 415... Línea 415...
415
            if ($result) {
415
            if ($result) {
416
                $this->logger->info('Se borro la pregunta ' . $questions->title, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
416
                $this->logger->info('Se borro la pregunta ' . $feed->title, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
417
 
417
 
418
                $data = [
418
                $data = [
Línea 419... Línea 419...
419
                    'success' => true,
419
                    'success' => true,
420
                    'data' => 'LABEL_RECORD_DELETED'
420
                    'data' => 'LABEL_RECORD_DELETED'
421
                ];
421
                ];