[Vuejs]-Check data match user type or not

0👍

When you want to remove characters from userType, you should do it in the backend. Can you show part of your code where you send reports? First of all, you should remove the array, which I show you in your example.

Logic example for send data from localstorage:

mounted() {
        fetch('http://localhost:3002/reports', this.getAuthUser)
            .then(res => res.json())
            .then(data => this.reports = data)
            .catch(err => console.log(err.message))
},
computed: {
   getAuthUser() {
      return window.localStorage.getItem('user');
   }
}

Leave a comment