Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

Update QueryApiUtils.js #230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Commits on Mar 13, 2018

  1. Update QueryApiUtils.js

    Hi,
    
    ```
     let formData = Object.keys(data).reduce((encoded, key) => {
          const encKey = encodeURIComponent(key);
          const encData = encodeURIComponent(data[key]);
          return `${encoded}&${encKey}=${encData}`
    }, '');
    ```
    Then:
    ```
    let data = {a: "1", b: "2"} // result of formData: &a=1&b=2
    ```
    So we should be replaced first **&** with an empty string, while we can create an **array** of keys and join them together with **&**.
    ali-master committed Mar 13, 2018
    Configuration menu
    Copy the full SHA
    527743b View commit details
    Browse the repository at this point in the history