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