Browse Source

fix(gui): handle api base url

Signed-off-by: Pranav C Balan <pranavxc@gmail.com>
pull/272/head
Pranav C Balan 4 years ago
parent
commit
a59e21e299
  1. 1
      packages/nc-gui/components/project/spreadsheet/apis/gqlApi.js
  2. 4
      packages/nc-gui/components/project/spreadsheet/apis/restApi.js

1
packages/nc-gui/components/project/spreadsheet/apis/gqlApi.js

@ -32,7 +32,6 @@ export default class GqlApi {
url, url,
method: 'post', method: 'post',
data: params, data: params,
baseURL: process.env.NODE_ENV === 'production' ? '/' : 'http://localhost:8080/'
}) })
} }

4
packages/nc-gui/components/project/spreadsheet/apis/restApi.js

@ -28,7 +28,6 @@ export default class RestApi {
return this.$axios({ return this.$axios({
url, url,
params, params,
baseURL: process.env.NODE_ENV === 'production' ? '/' : 'http://localhost:8080/'
}) })
} }
@ -45,7 +44,6 @@ export default class RestApi {
method: 'put', method: 'put',
url: `/nc/${this.$ctx.$route.params.project_id}/api/v1/${this.table}/${id}`, url: `/nc/${this.$ctx.$route.params.project_id}/api/v1/${this.table}/${id}`,
data, data,
baseURL: process.env.NODE_ENV === 'production' ? '/' : 'http://localhost:8080/'
}); });
const colName = Object.keys(data)[0]; const colName = Object.keys(data)[0];
this.$ctx.$store.dispatch('sqlMgr/ActSqlOp', [{dbAlias: this.$ctx.nodes.dbAlias}, 'xcAuditCreate', { this.$ctx.$store.dispatch('sqlMgr/ActSqlOp', [{dbAlias: this.$ctx.nodes.dbAlias}, 'xcAuditCreate', {
@ -64,7 +62,6 @@ export default class RestApi {
method: 'post', method: 'post',
url: `/nc/${this.$ctx.$route.params.project_id}/api/v1/${this.table}`, url: `/nc/${this.$ctx.$route.params.project_id}/api/v1/${this.table}`,
data, data,
baseURL: process.env.NODE_ENV === 'production' ? '/' : 'http://localhost:8080/'
})).data; })).data;
} }
@ -72,7 +69,6 @@ export default class RestApi {
return this.$axios({ return this.$axios({
method: 'delete', method: 'delete',
url: `/nc/${this.$ctx.$route.params.project_id}/api/v1/${this.table}/${id}`, url: `/nc/${this.$ctx.$route.params.project_id}/api/v1/${this.table}/${id}`,
baseURL: process.env.NODE_ENV === 'production' ? '/' : 'http://localhost:8080/'
}) })
} }

Loading…
Cancel
Save