Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 13 13:31
    brooksbecton commented #59
  • Aug 30 10:36
    VoronV48 commented #1069
  • Aug 30 10:35
    VoronV48 commented #1069
  • Aug 30 10:35
    VoronV48 commented #1069
  • Aug 24 03:37
    VoronV48 commented #5001
  • Aug 17 11:00
    emollett closed #5010
  • Aug 17 11:00
    emollett opened #5010
  • Aug 17 10:31
    emollett closed #5009
  • Aug 17 10:31
    emollett opened #5009
  • Jul 27 18:26
    taswarabbassss commented #3994
  • Jul 20 18:58
    jamiebuilds closed #4136
  • Jun 17 05:20
    jossmac unassigned #3262
  • Jun 14 20:06
    jupazave closed #4555
  • Mar 18 16:42
    apfel-das commented #3994
  • Mar 06 07:07
    sounishnath003 commented #3994
  • Feb 15 03:45

    dcousens on point-readme-to-ks6

    (compare)

  • Feb 15 03:45

    dcousens on master

    Point keystone-classic readme t… don't dance around the wording Merge pull request #5008 from k… (compare)

  • Feb 15 03:45
    dcousens closed #5008
  • Feb 15 03:45

    dcousens on point-readme-to-ks6

    don't dance around the wording (compare)

  • Feb 15 03:45
    dcousens synchronize #5008
tsuNammi
@tsuNammi
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
tsuNammi
@tsuNammi
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
weird though
tsuNammi
@tsuNammi
well update;
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
Ghost
@ghost~56835aa516b6c7089cc090e9
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
Max Ma
@max8hine_twitter
@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.
Ghost
@ghost~56835aa516b6c7089cc090e9
isn't that just for the first model though?
what about subsequent models
(i've already used the yo generator to start my project)
Max Ma
@max8hine_twitter
I am new to keystone tho, as far as I know, yo generator only for the first time when you initial the site.
Ghost
@ghost~56835aa516b6c7089cc090e9
yeah, that much was obivous
i remember back around 2016, there was some sort of cli tool to generate models + updates (then called migrations?)
it seems i'm remembering wrong though, oh well
thanks anyway
1337cookie
@1337cookie
@Lemmmy Sounds like laravel.
Kraig Hufstedler
@kraigh
I have maybe a dumb question, but can someone explain why in a keystone route you can simply do "var locals = res.locals" and then write new properties to that locals object, and it is available in the view without having to write back to res.locals? Is locals = res.locals some sort of pass by reference? Just trying to understand how it works.
Max Ma
@max8hine_twitter
For all I know, Object in Javascript just works in that way. for the deeper reason of how assignment operator works? , dunno about it.
const obj = { greeting: { action: 'hello', object: 'world' } }
const { greeting } = obj
greeting.object = 'you'
console.log(obj.greeting) // {action: "hello", object: "you"}
David Finton
@dfinton
@kraigh Yes, if you have var locals = res.locals then modifying locals will also modify res.locals because you only copied over the reference to the object rather than the object itself. If you want to make a copy of res.locals to a variable called locals and modify that without also modifying the original, you want to use the following code:
var locals = Object.assign({}, res.locals);
Object.assign(...) takes the first object and assigns values from all objects following it to that value. In this case, we're copying the values of res.locals to the empty object {}, effectively copying all the values of res.locals into a new object
Note that this is a shallow copy only. If you have nested objects, the above method won't create new objects for those. You'll need to write a recursive function that does that. A quick google search will tell you how to do that without too much effort :)
Kraig Hufstedler
@kraigh
Interesting, thanks for the help guys! I come from PHP and it works backwards, by default it passes just the value, and you have to specify if its pass by reference. Thanks for the help!
Max Ma
@max8hine_twitter
@dfinton that's very helpful. assignment operator will mutate the original object. but it works differently in Array. very intersting.
Max Ma
@max8hine_twitter
Any thought on the API Auth methods? (JWT)Key based API Auth vs. Session based API Auth?
Max Ma
@max8hine_twitter
I read few articles about JWT based Auth, seems it has some pitfalls, such as where to store, expiry times, etc. but what's the good part of using JWT?
Mitul Patel
@mitul69
Hello Is there way i will store settings in Database without listing
Directly i can update it ?
Vamshi Bachaneboina
@vamshi9
Hey! I have been struggling with the date picker in admin panel. Can I get date picker as in only Year picker? I can do it with Types.Select but it is kinda manual work right to write all the years!
1337cookie
@1337cookie
@vamshi9
year: { type: Types.Date, format: 'YYYY' }
I think the admin UI should automatically adjust, cant be sure though.
Navid
@navidshad
hey, I cant start keystone on pm2. pm2 could not read "COOKIE_SECRET" from .env file.
I set an environment variable in pm2 config file but I got the error again.
what shall I do ?