Improvement from PR comments
This commit is contained in:
parent
2a4eedcf38
commit
d3337a0219
|
@ -49,10 +49,6 @@ export interface Table extends Document {
|
|||
sourceId?: string
|
||||
relatedFormula?: string[]
|
||||
constrained?: string[]
|
||||
_id?: string
|
||||
_rev?: string
|
||||
createdAt?: string
|
||||
updatedAt?: string
|
||||
indexes?: { [key: string]: any }
|
||||
dataImport?: { [key: string]: any }
|
||||
}
|
||||
|
|
|
@ -9,19 +9,19 @@ export default class RowsApi {
|
|||
this.api = apiClient
|
||||
}
|
||||
|
||||
async getAll(id: string): Promise<[Response, Row[]]> {
|
||||
const response = await this.api.get(`/${id}/rows`)
|
||||
async getAll(tableId: string): Promise<[Response, Row[]]> {
|
||||
const response = await this.api.get(`/${tableId}/rows`)
|
||||
const json = await response.json()
|
||||
return [response, json]
|
||||
}
|
||||
async add(id: string, body: any): Promise<[Response, Row]> {
|
||||
const response = await this.api.post(`/${id}/rows`, { body })
|
||||
async add(tableId: string, body: any): Promise<[Response, Row]> {
|
||||
const response = await this.api.post(`/${tableId}/rows`, { body })
|
||||
const json = await response.json()
|
||||
return [response, json]
|
||||
}
|
||||
|
||||
async delete(id: string, body: any): Promise<[Response, Row[]]> {
|
||||
const response = await this.api.del(`/${id}/rows/`, { body })
|
||||
async delete(tableId: string, body: any): Promise<[Response, Row[]]> {
|
||||
const response = await this.api.del(`/${tableId}/rows/`, { body })
|
||||
const json = await response.json()
|
||||
return [response, json]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue