Hello guys,
I have problem with add book method. I will put pictures of my controller, my service, and my console. When i try to save book to data base, in console give me this, but in db nothing happend.
29 messages · Page 1 of 1 (latest)
Hello guys,
I have problem with add book method. I will put pictures of my controller, my service, and my console. When i try to save book to data base, in console give me this, but in db nothing happend.
⌛ This post has been reserved for your question.
Hey @dry spire! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Can you just post the relevant code snippets
i can give you my git repo ?
Sure
ok
i use workbench to check db
Contribute to StefanPYordanov/BookLibrary development by creating an account on GitHub.
i know my whole project is a mess, i am sorry for that
Yeah I see nothing wrong here
Maybe your db view isn't refreshing?
Or your db isn't configured to the port you think?
when i add author, my db show new author, but nothing happend when i add book
so i guess its not from workbench, i refresh it
its just with the 3 books from db init
and it dosent redirect me after successful adding a book
so i guess there is a problem with something
and i have redirect after successful adding a book
btw in inspector it give me status code 302 for POST
is it normal to give me this status code
Yes, that's a redirect response
I guess just boot up your app in the debugger and set a breakpoint in the controller to see what's going wrong
i do this, but never hit the breakpoint where is repo.save()
i found my problem, my dto have null field, but this field is coming from option html, so how to take option with thymeleaf and map it to dto ?
i fix it ty for your help, i am very greatful