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