I am working on creating a function that takes two parameters, a string and an array. The array is meant to be filled with data obtained from Axios. However, I am encountering the issue {'assignment' is assigned a value but never used.}. My goal is for the 'this.quizzAllCategories' to be equal to the 'assignment' parameter.
callAPI(params: string, assignment: quizzType[]) {
axios
.get(`https://printful.com/test-quiz.php?action=${params}`)
.then((res) => {
assignment = res.data;
});
},
},
async created() {
await this.callAPI("quizzes", this.quizzAllCategories);
},