Created
          December 23, 2024 06:29 
        
      - 
      
- 
        Save KMJ-007/18d8824b88ddff6f4f45540166ac318b to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | export const axiosParamsSerializer: AxiosRequestConfig["paramsSerializer"] = (params) => { | |
| const newParams = []; | |
| for (const k in params) { | |
| if (params[k] === undefined) { | |
| continue; | |
| } | |
| if (Array.isArray(params[k]) || typeof params[k] === "object") { | |
| newParams.push(`${k}=${encodeURIComponent(JSON.stringify(params[k]))}`); | |
| } else { | |
| newParams.push(`${k}=${encodeURIComponent(params[k])}`); | |
| } | |
| } | |
| return newParams.join("&"); | |
| }; | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment