Fix error on editing plan

This commit is contained in:
Brandon Presley 2022-09-04 17:33:05 +12:00
parent 597aa15110
commit 4b35a526b4
2 changed files with 6 additions and 2 deletions

View File

@ -37,7 +37,10 @@ export default function EditPlan() {
);
useEffect(() => {
getNames().then(setNames);
getNames().then(n => {
console.log(EditPlan.name, {n});
setNames(n);
});
}, []);
const save = useCallback(async () => {

View File

@ -102,7 +102,8 @@ export const setSetImage = async (name: string, image: string) => {
export const getNames = async (): Promise<string[]> => {
const [result] = await db.executeSql('SELECT DISTINCT name FROM sets');
return result.rows.raw();
const values: {name: string}[] = result.rows.raw();
return values.map(value => value.name);
};
export const getWorkouts = async ({