[Vuejs]-Typescript interface is not mapping to response

1👍

Your problem is at runtime, during the execution, so this is not related with Typescript at all.

Here, you forgot to return the promise in your method, so you return a Promise<void>.

async test() {
    // return the promise
    return judgeApi.post<JudgeRequest>(`/submissions?${qs.stringify({
          language_id: 60,
          source_code: "cGFja2FnR29vZCBq...wbGUubmFtZSkKfQo=",
          stdin: "Sn...w"
    })}`)
    .then(res => {
         return res.data.token
    })
    .catch(err => {
        console.log("error" + err);
    })
},

Leave a comment