Skip to content

Commit

Permalink
feat(rn) add qs param serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
lakardion committed Aug 15, 2024
1 parent 08b766e commit ca361b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@
"expo-web-browser": "~13.0.3",
"jotai": "^2.7.1",
"nativewind": "^4.0.36",
"qs": "^6.13.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.74.1",
"react-native-actions-sheet": "^0.9.6",
"react-native-gesture-handler": "~2.16.1",
"react-native-pager-view": "6.3.0",
"react-native-reanimated": "~3.10.1",
Expand All @@ -74,8 +76,7 @@
"rn-navio": "0.0.6",
"rollbar-react-native": "^0.9.3",
"zod": "3.21.4",
"zustand": "^4.3.3",
"react-native-actions-sheet": "^0.9.6"
"zustand": "^4.3.3"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand All @@ -85,6 +86,7 @@
"@tanstack/eslint-plugin-query": "5.35.6",
"@types/i18n-js": "^3.8.3",
"@types/lodash": "^4.14.185",
"@types/qs": "^6.9.15",
"@types/react": "~18.2.14",
"@types/react-dom": "~18.2.25",
"@typescript-eslint/eslint-plugin": "^5.37.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import axios, { AxiosError } from 'axios'
import { useAuth } from '@stores/auth'
import axios, { AxiosError } from 'axios'
import qs from 'qs'
import Config from '../../Config'

const baseUrl =
Expand All @@ -8,6 +9,9 @@ const baseUrl =
: `${Config?.backendServerUrl}`
export const axiosInstance = axios.create({
baseURL: `${baseUrl}/api`,
paramsSerializer: (params) => {
return qs.stringify(params, { arrayFormat: 'repeat' })
},
})
console.log('axiosInstance', `${baseUrl}/api`)
axiosInstance.interceptors.request.use(
Expand Down

0 comments on commit ca361b8

Please sign in to comment.