inertia icon indicating copy to clipboard operation
inertia copied to clipboard

Behaviour replace not working using router.reload when query String Array Format is set as 'indices'

Open jhospina opened this issue 1 year ago • 3 comments

Version:

  • @inertiajs/vue3 version: 1.0.7

Describe the problem:

Behaviour replace not working using router.reload when query String Array Format is set as 'indices'

Steps to reproduce:

I have this code

router.reload({
    data: {
      filters: [{field: 'category_id', operator: '=', value: categoryId}]
    },
    queryStringArrayFormat: 'indices',
    replace: true,
  })

but is adding new query params instead replace when execute the same code multi times.

Expected:

?filters[][field]=category_id&filters[][operator]=%3D&filters[][value]=2

Current:

?filters[][field]=category_id&filters[][operator]=%3D&filters[][value]=2&filters[][field]=category_id&filters[][operator]=%3D&filters[][value]=3

jhospina avatar Oct 22 '23 15:10 jhospina

Can confirm this is happening on my side as well. I don't think the queryStringArrayFormat impacts that in any way. I have the same results using both brackets and indices

IP-Developer avatar Jan 18 '24 16:01 IP-Developer

Me too

vitalijalbu avatar Jan 18 '24 18:01 vitalijalbu

same thing for me

jamesparkes avatar Aug 17 '24 14:08 jamesparkes