title: Filter the JSON object where value is not empty or not null on created function on vue.js 3
body: <p>I want to get the response.data (JSON Object) with value only in the new object on update form i.e. I want to filter it on computed/created on vue 3 - the json object received from API. My backend is Laravel 8 resource API.</p>
  <p>On EditPatient.vue - The vue js is</p>
  <pre><code>export default {
      data() {
          return {
              patient: {},
  
          }
      },
      created() {        
        this.$axios.get('/sanctum/csrf-cookie').then(response =&gt; {
              this.$axios.get(`/api/patients/${this.$route.params.id}`)
                  .then(response =&gt; {
                      this.patient = response.data // JSON object
                      /* .filter(function(item) {
                      item !== null || item !=='';
                      }) */ // this didn't work. 
                         //I want to response.data and apply to this.patient object. 
                  })
                  .catch(function (error) {
                      console.error(error);
                  });
          })
      },
  } 
  </code></pre>
  <p>response.data is</p>
  <pre><code>{ &quot;created_by&quot;: 1, &quot;firstname&quot;: &quot;Kamal&quot;, &quot;lastname&quot;: &quot;&quot;, &quot;sex&quot;: &quot;M&quot;, &quot;address&quot;: &quot;Kathmandu, Bagmati, Nepal&quot;, &quot;education&quot;: &quot;Yes&quot;, &quot;grade&quot;: &quot;MSc&quot;, &quot;alcohol&quot;: null, &quot;alcohol_type&quot;: null, &quot;weight&quot;: &quot;&quot;, &quot;kidney_disease&quot;: null, &quot;high_bp&quot;: &quot;No&quot;, &quot;diabetes&quot;: null, &quot;heart_attack_stroke&quot;: &quot;No&quot;,  &quot;present_diabetes&quot;: &quot;No&quot;,  &quot;systolic&quot;: &quot;&quot;, &quot;pulse_rate&quot;: &quot;&quot; }
  </code></pre>
  <p>On laravel api, I got a patient row as follow:</p>
  <pre><code>public function show($id)
      {
          $patient = Patient::find($id);
          return response()-&gt;json($patient); // send data in json ojbect for frontend
      }
  </code></pre>
  <p>It is better, If I can apply on backend too. Get the columns of single row which has value only.</p>