Browse Source

Fix me pls?

master
Stian Fredrik Aune 4 years ago
parent
commit
b23e16b4f6
  1. 2
      my-bois/background.js
  2. 2
      my-bois/src/hooks/net.js

2
my-bois/background.js

@ -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}));

2
my-bois/src/hooks/net.js

@ -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) {

Loading…
Cancel
Save