the above link explained why use view.on('init') over view.on('get') in indirect way. 🤔
thanks man, but I guess I've already handled it with if/else statements in the headerpartial file. it's not nice and clean, but I figured if ppl went to a /post/id-that-does-not-exist, the only problem wouldn't just be the title
there's a lot of stuff in the post-template that would need to access a data.post which does not exist, and I can't handle them cleanly at the same time
doesn't matter anyways
I just send them to a 404/500 error default page instead handling all the errorenous database calls for an object that doesn't exist with if/else before actually making a default template with 'post not found'
unless anyone else has a better idea when ppl try to access a post/'slug' that does not exist
Hi All, is there a way to detect if data has come from an update in a model? basically I want to add a mongoose post hook that only triggers from admin ui saves and not updates.
woo @JedWatson is back
@sordfish have you tried the getUpdateHandler API from keystone? that API could help me to modify the data before update the model.
so I tried deploying today
ran into a reaaaally weird problem
I have <strong> tags all over when I "inspect" using Chrome Inspector
they don't appear when I "view page source"
it's messing up my front end
I have no idea where to begin
it has something to do with the text that I've fetched from MongoDB
maaaybe because I have some a tags and strong tags entered into the content in the MongoDB
it appears normal when I access mongo shell and look at the objects
or it started when I started filling in stuff with a/strong tags in I think
but I have the same code running on cloud9
and no problems there
tried downgrading node versions to match cloud9's
but no success
found out what it caused it
it was a if/else statement within a forEach.function() that would either .substring () a data entry from MongoDB or not based on str.length
removed the if/else statement and it worked instantly
it wasn't just the if/else
it was the substring method itself
so I had to remove it
the everything was fine
substring() on a data.post.brief inside a forEach(function()
maybe something async stuff that does this ?
anyways, OK for now, kinda sucks if it was for a real customer
hey there - i last used keystone around 2 years ago, so i forgot a lot of things about it
i vaguely remember needing to use a command-line utility to create models, but can't find any mention of it in the documentation
am i remembering wrong, or was it removed?
or am i just silly and can't fidn it
@Lemmmy I think you are looking for the yeoman generator. It will ask you what kind of model you want to add on during the build time.