Skip to content

Commit a7a1176

Browse files
committed
oxql: roll schemasTable into schemas
1 parent b4ef27c commit a7a1176

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

app/api/window.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@ if (typeof window !== 'undefined') {
3232
schemas: async (search?: string) => {
3333
const result = await api.methods.timeseriesSchemaList({ query: { limit: 1000 } })
3434
const data = handleResult(result)
35-
if (!search) return data.items
36-
return data.items.filter((s) => s.timeseriesName.includes(search))
35+
36+
let filtered = data.items
37+
if (search) {
38+
filtered = filtered.filter((s) => s.timeseriesName.includes(search))
39+
}
40+
// note we both print as table _and_ return in case the caller wants the data
41+
console.table(filtered)
42+
return filtered
3743
},
38-
schemasTable: async (search?: string) =>
39-
// @ts-expect-error
40-
console.table(await window.oxql.schemas(search)),
4144
}
4245
}

0 commit comments

Comments
 (0)