Fix me pls?
This commit is contained in:
@@ -4,7 +4,7 @@ function sendRequest(path, method, body, sendResp) {
|
|||||||
headers: method !== "GET" ? {
|
headers: method !== "GET" ? {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
} : undefined,
|
} : undefined,
|
||||||
body: body ? JSON.stringify(body) : undefined,
|
body: body !== null ? JSON.stringify(body) : undefined,
|
||||||
}).then(r => r.json())
|
}).then(r => r.json())
|
||||||
.then(data => sendResp({success: true, data}))
|
.then(data => sendResp({success: true, data}))
|
||||||
.catch(e => sendResp({success: false, message: e.message}));
|
.catch(e => sendResp({success: false, message: e.message}));
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export async function createNewWorkout(bike, program) {
|
|||||||
const bikeId = bike.id;
|
const bikeId = bike.id;
|
||||||
const programId = program.id;
|
const programId = program.id;
|
||||||
|
|
||||||
return await runBack({query: "fetchActiveWorkouts", bikeId, programId});
|
return await runBack({query: "createNewWorkout", bikeId, programId});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function connectWorkout(workout) {
|
export async function connectWorkout(workout) {
|
||||||
|
|||||||
Reference in New Issue
Block a user