diff --git a/prisma/dev.db b/prisma/dev.db index 91f05e7..9c6c0b9 100644 Binary files a/prisma/dev.db and b/prisma/dev.db differ diff --git a/src/app/ui/tables/inputs/genrePickerInput.tsx b/src/app/ui/tables/inputs/genrePickerInput.tsx index ddedd5f..9136632 100644 --- a/src/app/ui/tables/inputs/genrePickerInput.tsx +++ b/src/app/ui/tables/inputs/genrePickerInput.tsx @@ -24,25 +24,25 @@ export default function GenrePickerInputCell(props: CellContext) { const genres = props.table.options.meta.genres const [isActive, setIsActive] = useState(false) - async function onSubmit({ genres }: { genres: number[] }, event: Event) { + async function onSubmit({ genres }: { genres: number[] }) { event.preventDefault() const genresArray = genres.map((e) => { return { id: e } }) console.log(`genres: ${genres}, genresArray: ${JSON.stringify(genresArray)}`) - // toast({ - // title: "You submitted the following values:", - // description: ( - //
-    //       {JSON.stringify(genres)}
-    //     
- // ), - // }) - // const res = await updateGenres({ - // id, - // table, - // genres: genresArray, - // pathname - // }) - // setIsActive(false) + toast({ + title: "You submitted the following values:", + description: ( +
+          {JSON.stringify(genres)}
+        
+ ), + }) + const res = await updateGenres({ + id, + table, + genres: genresArray, + pathname + }) + setIsActive(false) } function onErrors(errors) { @@ -65,11 +65,14 @@ export default function GenrePickerInputCell(props: CellContext) { genres: value.map(e => e.id) } }) + + const formId = "editGenresForm" + props.cell.id + return (
- - + + setIsActive(prev => !prev)}> ) { }} /> ))} - +