by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 08 12:57
    trimentor starred canjs/canjs
  • Aug 07 19:43

    cherifGsoul on 5.x-legacy

    Can5 YouTube terms of service (… (compare)

  • Aug 07 19:43
    cherifGsoul closed #5503
  • Aug 07 19:39

    cherifGsoul on can4-youtube-terms-services

    Can4 YouTube terms of service (compare)

  • Aug 07 19:34
    cherifGsoul opened #5503
  • Aug 07 19:33

    cherifGsoul on add-youtube-policy-notice-for-v5

    Can5 YouTube terms of service (compare)

  • Aug 07 18:37

    cherifGsoul on add-youtube-terms-of-service

    (compare)

  • Aug 07 18:37

    cherifGsoul on master

    Add youtube and google terms of… (compare)

  • Aug 07 18:37
    cherifGsoul closed #5502
  • Aug 07 18:28
    cherifGsoul review_requested #5502
  • Aug 07 18:28
    cherifGsoul opened #5502
  • Aug 07 18:28

    cherifGsoul on add-youtube-terms-of-service

    Add youtube and google terms of… (compare)

  • Aug 05 19:54

    cherifGsoul on master

    Update dist for release (compare)

  • Aug 05 19:54

    cherifGsoul on v6.6.0

    Update dist for release 6.6.0 (compare)

  • Aug 05 19:40

    cherifGsoul on update-can-type-115

    (compare)

  • Aug 05 19:40

    cherifGsoul on master

    Update can-type to 1.1.5 (#5501) (compare)

  • Aug 05 19:40
    cherifGsoul closed #5501
  • Aug 05 19:14
    cherifGsoul opened #5501
  • Aug 05 19:13

    cherifGsoul on update-can-type-115

    Update can-type to 1.1.5 (compare)

  • Aug 05 19:10

    cherifGsoul on update-youtube-logo

    (compare)

Matthew Phillips
@matthewp
There's the combine-requests behavior that combines requests together
not sure if it works for saving though...
pinging @justinbmeyer in case he has a solution for this
I think combine-requests only works for getting lists
Justin Meyer
@justinbmeyer
I think someone asked this and posted solution in the forums
kostya.aderiho
@kaderiho
Seems that combineRequests works only for get (getListData) requests (according to the documentation), is it correct guys or not?
Frank Lemanschik
@frank-dspeed
i would say
1 reqest per save is total ok
if you need to save more data then simply do a custom batch via a endpoint that supports that
Matthew Phillips
@matthewp
@kaderiho yep, that is correct
Frank Lemanschik
@frank-dspeed
but out of my view you should save the item on creation
there is no case where you save more then 1 item at time and if you batch edit items via your interface directly
you end up in 1 request per processed item
thats total ok
else simply send item ids and changes to the backend and process them there
a batch endpoint would be a simple endpoint that accepts json lists
then you do getList and post that json to that endpoint
your done
the endpoint then takes that json list and does the for each serverside
I think that's the forum post @justinbmeyer is talking about
the linked to jsbin shows an example that does bulk deletes
Frank Lemanschik
@frank-dspeed
ya the question now is do you want to do bulk on the interface aka from the client side
or from the backend aka batch bulk enabled api endpoint
Justin Meyer
@justinbmeyer
@jeroencornelissen I think I shared some code too
Frank Lemanschik
@frank-dspeed
this is your code
it adds a destroyList method
that sends the json to a endpoint that does the foreach
:D
Justin Meyer
@justinbmeyer
that's my code?
Frank Lemanschik
@frank-dspeed
yes
Justin Meyer
@justinbmeyer
I generally don't write code like that
Matthew Phillips
@matthewp
it's from that forum post, not sure if you wrote it or @jeroencornelissen did
Frank Lemanschik
@frank-dspeed

@justinbmeyer suggested this on the gitter channel:

I would put a destroyList or some method on your list that makes the requests
and then call destroyedInstance on each one (assuming can-connect)

I have tried that but couldn’t make it work. The items are updated when calling Item.Connection.destroyedInstance(item, {title: 'destroyed'});. The title changes to destroyed, but I expected them to get removed from the list.

See this fiddle 3:

ah ok
it was gregromhild
sorry
:D
readed it wrong i tought he copyed your text
Justin Meyer
@justinbmeyer
I remember giving code IN gitter, I wish there was a link to the gitter thread
Frank Lemanschik
@frank-dspeed
if you got gitter pro
you should be able to find it
do you got a pro account?
it has infinity history and search
as far as i remember
Justin Meyer
@justinbmeyer
basically, the .save() on a list would need to update the instances correctly
there's a way to do that
Frank Lemanschik
@frank-dspeed
dispatch
Justin Meyer
@justinbmeyer
it's not dispatch