Hello guys I have a problem to handle error from validation Laravel i have service class
import axios from "axios";
import { LogIn } from "react-feather";
import Alert from "../components/Alert";
import { API_BASE_URL , BASE_URL} from "../config";
class UserService {
async getUserInformation(id){
try{
const result = await axios.get(API_BASE_URL + '/getUserInformation' , { params: { id: id } })
return result.data.users
}catch(e){
return false;
}
}
async saveUserInfromation(user){
try{
const result = await axios.put(API_BASE_URL + '/update' , user )
return result.data.users
}catch(e){
return e.response.data;
}
}
}
export default new UserService();
and this is my component I call the function from class service to edit user
import React, { Component } from "react";
class Clientedit extends Component {
constructor(props) {
super(props);
this.state = {
user : {},
oldPassword: "",
newPassword: "",
isLoading : true,
error : "",
};
}
componentDidMount() {
}
handleSubmit = (e) =>{
e.preventDefault();
let user = this.state.user;
try{
const res = UserService.saveUserInfromation(user);
}
catch(e){
}
}
}
}
export default withParams(Clientedit);
when I log error from service class I get it in my consol

but when I log it from my component I get nothing , any solution please
You must set password_confirmation parameter when updating your password