Skip to content

Commit

Permalink
Fix submission book data
Browse files Browse the repository at this point in the history
  • Loading branch information
esgoet committed Aug 16, 2024
1 parent 38d4ede commit 606012a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {useEffect, useState} from "react";
import {Link, Route, Routes} from "react-router-dom";
import BookDetailsPage from "./pages/BookDetailsPage/bookDetailsPage/BookDetailsPage.tsx";
import BookGalleryPage from "./pages/BookGalleryPage/bookGalleryPage/BookGalleryPage.tsx";
import AddBookForm from "./pages/BookGalleryPage/components/addBookButton/AddBookForm.tsx";
import AddBookForm from "./pages/BookGalleryPage/components/addBookForm/AddBookForm.tsx";
import Header from "./components/header/Header.tsx";


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ export default function AddBookForm({fetchBooks}: Readonly<FetchProps>) {
console.log(event);

axios.post("/api/books", {
title: book.title,
author: book.author,
...book,
genre: Object.keys(genres).find(
key => genres[key as keyof typeof genres] === book.genre),
publicationDate: book.publicationDate
key => genres[key as keyof typeof genres] === book.genre)
})
.then(() => fetchBooks())
.then(response => console.log(response))
Expand Down

0 comments on commit 606012a

Please sign in to comment.