Error on Part 4 of the tutorial?

27 views
Skip to first unread message

Oliver Thurtle

unread,
Jul 30, 2018, 7:33:51 AM7/30/18
to Keystone JS
Hi there all

Just dipping my toes into KeystoneJS, I've followed the tutorial and am trying to add data into the database through a simple webform. 

I've got to Part 4 in the tutorial (https://keystonejs.netlify.com/getting-started/setting-up/part-4/) but there seems to be an error in the code as I get the below once I submit the form.

Error thrown for request: /add-event

TypeError: Event is not a constructor


The line it errors on is 

var newEvent = new Event();
  Event.updateItem(newEvent, req.body);

in routes/api/event/post.js

The database is then not populated. 

Seems to potentially be an issue in the above file or models/Event.js? Trying to debug, but not sure where to start...

Thanks

Reply all
Reply to author
Forward
0 new messages