이게 axios를 이용해서 서버로 전송하는 코드

export const imageSave = (files, config) => {
const request = axios.post('/api/post/image', files, config).then(res=>{
if(res.data.success){
return res.data.imgpaths
}else alert('파일을 불러올수 없습니다');
});
return{
type: IMAGE,
imgpaths: request
}
}


그리규 이게 서버에서 그거 처리해서 클라이언트로 보내주는 코드

router.post('/image', (req, res)=>{
upload(req, res, err=>{
if(err) return res.status(400).json({success: false, err});
else{
let imgpaths=[];
for(let i=0; i<req.files.length; i++){
imgpaths.push(req.files[i].path);
}
return res.status(200).json({success: true, imgpaths: imgpaths});
}
})
})


근데 콘솔에 찍어보면 imgpaths값이 이렇게 나옴

imgpaths

  1. Promise {<pending>}
    1. [[Prototype]]: Promise
    2. [[PromiseState]]: "fulfilled"
    3. [[PromiseResult]]: Array(2)
      1. 0: "images\1632562357496_7.jpg"
      2. 1: "images\1632562357499_8.jpg"
      3. length: 2
      4. [[Prototype]]: Array(0)


PromiseResult값 어떻게 꺼내쓰는지 모르겠슴 ㅠㅠ
어케함??????????????


7bf3da36e2f206a26d81f6e447887765cb