Allow zero reps/weight but not null
This commit is contained in:
parent
d77b28e66c
commit
d1e3255a28
|
@ -17,6 +17,8 @@ export default function EditSet({
|
|||
const db = useContext(DatabaseContext);
|
||||
|
||||
const save = async () => {
|
||||
if (!set?.name || set?.reps === undefined || set?.weight === undefined)
|
||||
return;
|
||||
if (!set?.id)
|
||||
await db.executeSql(
|
||||
`INSERT INTO sets(name, reps, weight, created, unit) VALUES (?,?,?,?,?)`,
|
||||
|
|
Loading…
Reference in New Issue
Block a user