|
|
@ -12,7 +12,7 @@ export default class RestApi { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async read(id, params = {}) { |
|
|
|
async read(id, params = {}) { |
|
|
|
const data = await this.get(`/nc/${this.$ctx.projectId}/api/v1/${this.table}/${id}`, params) |
|
|
|
const data = await this.get(`/nc/${this.$ctx.projectId}/api/v1/${this.table}/${encodeURIComponent(id)}`, params) |
|
|
|
return data.data |
|
|
|
return data.data |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -67,7 +67,7 @@ export default class RestApi { |
|
|
|
async update(id, data, oldData) { |
|
|
|
async update(id, data, oldData) { |
|
|
|
const res = await this.$axios({ |
|
|
|
const res = await this.$axios({ |
|
|
|
method: 'put', |
|
|
|
method: 'put', |
|
|
|
url: `/nc/${this.$ctx.projectId}/api/v1/${this.table}/${id}`, |
|
|
|
url: `/nc/${this.$ctx.projectId}/api/v1/${this.table}/${encodeURIComponent(id)}`, |
|
|
|
data |
|
|
|
data |
|
|
|
}) |
|
|
|
}) |
|
|
|
const colName = Object.keys(data)[0] |
|
|
|
const colName = Object.keys(data)[0] |
|
|
@ -96,7 +96,7 @@ export default class RestApi { |
|
|
|
async delete(id) { |
|
|
|
async delete(id) { |
|
|
|
return this.$axios({ |
|
|
|
return this.$axios({ |
|
|
|
method: 'delete', |
|
|
|
method: 'delete', |
|
|
|
url: `/nc/${this.$ctx.projectId}/api/v1/${this.table}/${id}` |
|
|
|
url: `/nc/${this.$ctx.projectId}/api/v1/${this.table}/${encodeURIComponent(id)}` |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|