[Vuejs]-Send Patch request from vuejs to PHP backend using AxiosAbstraction

0👍

This is because you are trying to update the database without converting the data received from the frontend. The date sent from the Vue is converted during the HTTP transfer onto a string. You should be able to fix the issue by converting the date of birth into an actual date.

SimpleRouter::patch('promotor/changeDob', function($promotorID) {
  cors();
  global $promotor;
  $response = new \Response();
  $data = HTTP::data();
  $dob_time = strtotime($data->dob);

  $dob = date('Y-m-d', $dob_time); // use your preferred format here

  $promotor->update([
    'dob' => $dob
  ]);
   call promotor update dob
   $promotor->update([
     'dobChanged' => $data->1
   ]);
  \Response::json([
    'success'   => false
  ]);

  \Response::json($response_obj->error());
});

Leave a comment