Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 984 | Rev 986 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 984 Rev 985
Línea 66... Línea 66...
66
    params.set('page', '1')
66
    params.set('page', '1')
67
    history.replace(`/search/entity/${newCategory}?${params.toString()}`)
67
    history.replace(`/search/entity/${newCategory}?${params.toString()}`)
68
  }
68
  }
Línea 69... Línea 69...
69
 
69
 
-
 
70
  const onChangeAddress = (address = {}) => {
70
  const onChangeAddress = (address = {}) => {
71
    const urlParams = new URLSearchParams(search)
71
    params.set('page', '1')
72
    urlParams.set('page', '1')
Línea 72... Línea 73...
72
    const addressEntries = Object.entries(address)
73
    const addressEntries = Object.entries(address)
73
 
74
 
74
    params.forEach((value, key) => {
75
    urlParams.forEach((value, key) => {
75
      console.log(key, value)
76
      console.log(key, value)
Línea 76... Línea 77...
76
      if (!['page', 'keyword'].includes(key)) params.delete(key)
77
      if (!['page', 'keyword'].includes(key)) urlParams.delete(key)
Línea 77... Línea 78...
77
    })
78
    })
78
 
79
 
Línea 79... Línea 80...
79
    addressEntries.forEach(([key, value]) => value && params.set(key, value))
80
    addressEntries.forEach(([key, value]) => value && urlParams.set(key, value))
80
 
81
 
81
    history.replace(`${pathname}?${params.toString()}`)
82
    history.replace(`${pathname}?${urlParams.toString()}`)