Closed JordiGamez closed 2 years ago
After some tries, there was an issue in my DATETIME field where I was using 0000-00-00 00:00:00 instead of a valid value like 2022-08-02 21:51:29. After making that change (from zeros to valid date) it started working.
Hello!
I'm trying to obtain some articles from my MySQL database using Vapor-Fluent but there is something wrong with my Date type (I have read a little bit of Date type in Vapor but I'm not sure about how to solve this issue).
This is my Vapor-Fluent model:
This is my Controller:
This is the format of my Date type in my tbl_article table (it's DATETIME type in my MySQL database):
When I try to obtain the articles by visiting my URL, it returns the following error:
My question is:
What I have to change in order to make this work? I tried changing my model type to String but it didn't work, so maybe I have to change something related to the decoding process?
(I'm new to Vapor (I'm creating my first real MySQL connection and I don't know how to solve this issue regarding the Date type).).
Thanks!