Fix editing a workouts image

This commit is contained in:
Brandon Presley 2022-09-10 19:02:16 +12:00
parent d5c97b45b0
commit 03e284ed87
2 changed files with 6 additions and 3 deletions

View File

@ -8,7 +8,6 @@ import React, {useCallback, useState} from 'react';
import {Image, ScrollView, View} from 'react-native';
import DocumentPicker from 'react-native-document-picker';
import {Button, IconButton} from 'react-native-paper';
import {set} from 'react-native-reanimated';
import MassiveInput from './MassiveInput';
import {setWorkouts} from './plan.service';
import Set from './set';
@ -37,7 +36,11 @@ export default function EditWorkout() {
);
const update = useCallback(async () => {
console.log(`${EditWorkout.name}.update`, set);
console.log(`${EditWorkout.name}.update`, {
params: params.value.name,
name,
uri,
});
if (name) {
await setSetName(params.value.name, name);
await setWorkouts(params.value.name, name);

View File

@ -97,7 +97,7 @@ export const setSetName = async (oldName: string, newName: string) => {
export const setSetImage = async (name: string, image: string) => {
const update = `UPDATE sets SET image = ? WHERE name = ?`;
return db.executeSql(update, [name, image]);
return db.executeSql(update, [image, name]);
};
export const getNames = async (): Promise<string[]> => {