diff --git a/src/operators/api/models.ts b/src/operators/api/models.ts
index 6b0f0e4f..79405efb 100644
--- a/src/operators/api/models.ts
+++ b/src/operators/api/models.ts
@@ -33,9 +33,9 @@ export interface IResponse {
title: string;
description?: string;
example?: string;
- isSuccess: boolean;
- errorCode?: string;
- statusCode: number;
+ is_success: boolean;
+ error_code?: string;
+ status_code: number;
body: ISchema;
headers: ISchema;
}
@@ -50,10 +50,10 @@ export interface IApi {
tags?: string[];
request: IRequest;
responses: IResponse[];
- isFree?: boolean;
+ is_free?: boolean;
service?: string;
- createdAt?: string;
- updatedAt?: string;
+ created_at?: string;
+ updated_at?: string;
}
export interface IApiListResponse {
diff --git a/src/operators/api/operator.ts b/src/operators/api/operator.ts
index f1651fb5..12a5fa1f 100644
--- a/src/operators/api/operator.ts
+++ b/src/operators/api/operator.ts
@@ -1,5 +1,4 @@
import { AxiosResponse } from 'axios';
-import { decamelizeKeys } from 'humps';
import { httpClient } from '../instance';
import { IApi, IApiDetailResponse, IApiListResponse } from '../api/models';
@@ -13,7 +12,7 @@ class ApiOperator {
async getAll(query: IApiQuery): Promise
> {
return await httpClient.get(`/${this.key}/`, {
- params: decamelizeKeys(query)
+ params: query
});
}
diff --git a/src/operators/application/models.ts b/src/operators/application/models.ts
index bb75f157..1f74ae16 100644
--- a/src/operators/application/models.ts
+++ b/src/operators/application/models.ts
@@ -1,12 +1,12 @@
export interface IApplication {
id?: string;
service: string;
- apiKey?: string;
- userId?: string;
- remainingCount?: number;
- usedCount?: number;
- createdAt?: string;
- updatedAt?: string;
+ api_key?: string;
+ user_id?: string;
+ remaining_count?: number;
+ used_count?: number;
+ created_at?: string;
+ updated_at?: string;
}
export interface IApplicationListResponse {
diff --git a/src/operators/application/operator.ts b/src/operators/application/operator.ts
index 738eb76a..58b97871 100644
--- a/src/operators/application/operator.ts
+++ b/src/operators/application/operator.ts
@@ -1,10 +1,9 @@
import { AxiosResponse } from 'axios';
import { httpClient } from '../instance';
import { IApplication, IApplicationDetailResponse, IApplicationListResponse } from './models';
-import { camelizeKeys, decamelizeKeys } from 'humps';
export interface IApplicationQuery {
- userId: string;
+ user_id: string;
}
class ApplicationOperator {
@@ -12,7 +11,7 @@ class ApplicationOperator {
async getAll(query: IApplicationQuery): Promise> {
return await httpClient.get(`/${this.key}/`, {
- params: decamelizeKeys(query)
+ params: query
});
}
diff --git a/src/operators/instance.ts b/src/operators/instance.ts
index 7bb04513..304b92b3 100644
--- a/src/operators/instance.ts
+++ b/src/operators/instance.ts
@@ -1,7 +1,6 @@
import router from '@/router';
import store from '@/store';
-import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
-import { camelizeKeys, decamelizeKeys } from 'humps';
+import axios, { AxiosInstance } from 'axios';
import { getCookie } from 'typescript-cookie';
const httpClient: AxiosInstance = axios.create({
@@ -17,17 +16,11 @@ httpClient.interceptors.request.use((config) => {
if (accessToken) {
config.headers['Authorization'] = `Bearer ${accessToken}`;
}
- if (config.data) {
- config.data = decamelizeKeys(config.data);
- }
return config;
});
httpClient.interceptors.response.use(
(response) => {
- if (response.data && response.headers['content-type'] === 'application/json') {
- response.data = camelizeKeys(response.data);
- }
return response;
},
(error) => {
@@ -39,6 +32,4 @@ httpClient.interceptors.response.use(
}
);
-// const httpClient = (options: AxiosRequestConfig): Promise => instance.request(options);
-
export { httpClient };
diff --git a/src/operators/service/models.ts b/src/operators/service/models.ts
index a0b8df0d..6c615ed7 100644
--- a/src/operators/service/models.ts
+++ b/src/operators/service/models.ts
@@ -6,10 +6,10 @@ export interface IService {
thumbnail?: string;
icon?: string;
price?: number;
- appliedCount: number;
+ applied_count: number;
introduction: string;
- createdAt?: string;
- updatedAt?: string;
+ created_at?: string;
+ updated_at?: string;
}
export interface IServiceListResponse {
diff --git a/src/operators/service/operator.ts b/src/operators/service/operator.ts
index 4b49e1b8..8f4cf375 100644
--- a/src/operators/service/operator.ts
+++ b/src/operators/service/operator.ts
@@ -13,7 +13,7 @@ class ServiceOperator {
async getAll(query: IServiceQuery): Promise> {
return await httpClient.get(`/${this.key}/`, {
- params: decamelizeKeys(query)
+ params: query
});
}
diff --git a/src/pages/console/application/List.vue b/src/pages/console/application/List.vue
index 4d800795..7b6a9d77 100644
--- a/src/pages/console/application/List.vue
+++ b/src/pages/console/application/List.vue
@@ -41,7 +41,7 @@ export default defineComponent({
this.loading = true;
applicationOperator
.getAll({
- userId: this.$store.getters.user.id
+ user_id: this.$store.getters.user.id
})
.then(({ data: data }: { data: IApplicationListResponse }) => {
this.applications = data.items;
diff --git a/src/pages/service/Detail.vue b/src/pages/service/Detail.vue
index cd40c545..8d423454 100644
--- a/src/pages/service/Detail.vue
+++ b/src/pages/service/Detail.vue
@@ -37,7 +37,7 @@
-
{{ $t('service.message.appliedCount') }}: {{ service.appliedCount }}
+
{{ $t('service.message.appliedCount') }}: {{ service.applied_count }}