These are chat archives for canjs/canjs

13th
May 2017
Gira Minus
@gKreator
May 13 2017 03:05
what is the best way to do a modulus operator inside of stache, to only display something every 3rd item element
Nico R.
@nriesco
May 13 2017 08:47
I guet this warning/error in the console:
WARN: One or more items were retrieved which do not match the 'Set' parameters used to load them. Read the docs for more information: http://v3.canjs.com/doc/can-set.html#SolvingCommonIssues

Below are the 'Set' parameters:
{
  "superId": "5916162693bdb46cafff5337"
}

And below is an item which does not match those parameters:
{
  "_id": "5916162693bdb46cafff5337",
  "name": "Carbon4",
  "productParentId": "5915cef093bdb46cafff5334”
}
How can I fix it? is it really an error ?
Brad Momberger
@bmomberger-bitovi
May 13 2017 17:18
@gKreator I'd just write a stache helper
@nriesco is that a response from your API? A default can-set (can-connect connections use can-sets) expects that parameters passed to your find query (which make up a set) will exist on your returned objects (so that the set can match them). There are ways to ignore those params, though
See where it says "ignore this property in set algebra" in https://canjs.com/doc/can-set.props.html
Brad Momberger
@bmomberger-bitovi
May 13 2017 17:23
or you could pass "superId" back as part of the result.
Nico R.
@nriesco
May 13 2017 23:56
Thanks @bmomberger-bitovi I added a post-hook in feathers to add superId and it solved that warning/error
In case someone is interested in why I use superId is just because somewhere in my app, probably can-connect-feathers is not working when querying by _id, probably because of the _ in the name. I also had to add a pre-hook to search by objectId(value) to really make it work