Commit 5ca7dc06 authored by Kevin Mentzoni Halvarsson's avatar Kevin Mentzoni Halvarsson
Browse files

fixed code smell no-async-promise-executor

parent 6d0299c0
Pipeline #128694 canceled with stages
async function fetchExerciseTypes() {
return new Promise(async (resolve, reject) => {
const response = await sendRequest("GET", `${HOST}/api/exercises/`);
if(response.ok) {
const data = await response.json();
const exercises = data.results;
resolve(exercises);
} else {
reject(response);
}
const url = `${HOST}/api/exercises/`
let response = await sendRequest("GET", url);
if (!response.ok) {
throw response;
} else {
let data = await response.json();
let exercises = data.results;
});
return exercises;
}
}
async function fetchWorkouts(ordering) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment