Fix error on editing plan
This commit is contained in:
parent
597aa15110
commit
4b35a526b4
|
@ -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 () => {
|
||||
|
|
|
@ -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 ({
|
||||
|
|
Loading…
Reference in New Issue
Block a user