Type anys
This commit is contained in:
parent
022df7cda4
commit
d465f7e057
|
@ -3,7 +3,15 @@ import { BaseAPIClient } from "./types"
|
||||||
|
|
||||||
export interface ViewEndpoints {
|
export interface ViewEndpoints {
|
||||||
// Missing request or response types
|
// Missing request or response types
|
||||||
fetchViewData: (name: string, opts?: any) => Promise<Row[]>
|
fetchViewData: (
|
||||||
|
name: string,
|
||||||
|
opts: {
|
||||||
|
calculation?: string
|
||||||
|
field?: string
|
||||||
|
groupBy?: string
|
||||||
|
tableId: string
|
||||||
|
}
|
||||||
|
) => Promise<Row[]>
|
||||||
exportView: (name: string, format: string) => Promise<any>
|
exportView: (name: string, format: string) => Promise<any>
|
||||||
saveView: (view: any) => Promise<any>
|
saveView: (view: any) => Promise<any>
|
||||||
deleteView: (name: string) => Promise<any>
|
deleteView: (name: string) => Promise<any>
|
||||||
|
@ -20,7 +28,7 @@ export const buildViewEndpoints = (API: BaseAPIClient): ViewEndpoints => ({
|
||||||
fetchViewData: async (name, { field, groupBy, calculation }) => {
|
fetchViewData: async (name, { field, groupBy, calculation }) => {
|
||||||
const params = new URLSearchParams()
|
const params = new URLSearchParams()
|
||||||
if (calculation) {
|
if (calculation) {
|
||||||
params.set("field", field)
|
params.set("field", field!)
|
||||||
params.set("calculation", calculation)
|
params.set("calculation", calculation)
|
||||||
}
|
}
|
||||||
if (groupBy) {
|
if (groupBy) {
|
||||||
|
|
Loading…
Reference in New Issue