From 4bcc53a759411a0b2ee21638c62352ddf5952ed3 Mon Sep 17 00:00:00 2001
From: nicrausaz <n.crausaz99@gmail.com>
Date: Thu, 4 Jul 2019 13:39:30 +0200
Subject: [PATCH] Fix candidatures sans notes

---
 .../API/app/Http/Controllers/ApplicantsController.php     | 8 +++++---
 canapGEST/Site/src/views/ApplicationsView.vue             | 7 +++----
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/canapGEST/API/app/Http/Controllers/ApplicantsController.php b/canapGEST/API/app/Http/Controllers/ApplicantsController.php
index 289013e..be172ae 100644
--- a/canapGEST/API/app/Http/Controllers/ApplicantsController.php
+++ b/canapGEST/API/app/Http/Controllers/ApplicantsController.php
@@ -41,8 +41,10 @@ class ApplicantsController extends Controller
       ->join('position', 'applicant.fk_position', '=', 'position.position_id')
       ->join('job', 'position.fk_job', '=', 'job.job_id')
       ->join('location', 'position.fk_location', '=', 'location.location_id')
-      ->join('marker', 'applicant.applicant_id', '=', 'marker.fk_applicant_id')
-      ->where('marker_owner_sciper', $this->user_sciper)
+      ->leftJoin('marker', function($join) {
+        $join->on('applicant.applicant_id', '=', 'marker.fk_applicant_id');
+        $join->where('marker_owner_sciper', $this->user_sciper);
+      })
       ->where('fk_status', 'Valide')
       ->get();
     }
@@ -52,7 +54,7 @@ class ApplicantsController extends Controller
         array_push($applicants, $applicant);
       }
     }
-   return $applicants;
+    return $applicants;
   }
 
   public function getJobApplicants($job)
diff --git a/canapGEST/Site/src/views/ApplicationsView.vue b/canapGEST/Site/src/views/ApplicationsView.vue
index 4c3014e..7234b04 100644
--- a/canapGEST/Site/src/views/ApplicationsView.vue
+++ b/canapGEST/Site/src/views/ApplicationsView.vue
@@ -91,10 +91,9 @@
             <td>{{ props.item.applicant_scolarity_end }}</td>
             <td>{{ getFormatedDate(props.item.applicant_application_date) }}</td>
             <td v-if="!$store.getters['moduleUser/userIsResponsible']">
-              <span>
-                {{props.item.marker_value}}
-                <v-icon inline small>star_rating</v-icon>
-              </span>
+              <span v-if="props.item.marker_value !== null">{{props.item.marker_value}}</span>
+              <span v-else>∅</span>
+              <v-icon inline small>star_rating</v-icon>
             </td>
             <td>
               <v-select
-- 
GitLab