How to return axios get value instead of [object Promise]?

Axios get function always returning Promise even though I get the value in console.log

I use this code inside my vue js function

async encFolderID(_id){
        if(_id > 0){
            await axios.get(base_url+'Main/Process/FilesStorage/encFolderID/'+ _id).then(response => {
                return response.data.enc_id;
            })
        }
    },

Answer

You don’t need to use .then(). Just async and await.

This is how you should use them:

async encFolderID(_id){
        if(_id > 0){
            const resp = await axios.get(base_url+'Main/Process/FilesStorage/encFolderID/'+ _id);
            return resp.data.enc_id
        } else ...
    },