Skip to content

Commit ba2be2d

Browse files
fernandatoledoasdolo
authored andcommitted
Merge pull request #28 from rootstrap/fix/interceptor
Fix axios nterceptor
2 parents 0a67402 + 3a22a01 commit ba2be2d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/api/common/interceptors.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { toCamelCase, toSnakeCase } from './utils';
55

66
export default function interceptors() {
77
client.interceptors.request.use((config: InternalAxiosRequestConfig) => {
8-
config.data = toSnakeCase(config.data);
8+
if (config.data) {
9+
config.data = toSnakeCase(config.data);
10+
}
911
return config;
1012
});
1113

0 commit comments

Comments
 (0)