Support saving queryUI.

This commit is contained in:
mike12345567 2024-10-02 18:43:07 +01:00
parent 4d33106b45
commit 9e7ed04719
2 changed files with 6 additions and 5 deletions

View File

@ -99,10 +99,11 @@ export async function create(ctx: Ctx<CreateViewRequest, ViewResponse>) {
const schema = await parseSchema(view)
const parsedView: Omit<RequiredKeys<ViewV2>, "id" | "version" | "queryUI"> = {
const parsedView: Omit<RequiredKeys<ViewV2>, "id" | "version"> = {
name: view.name,
tableId: view.tableId,
query: view.query,
queryUI: view.queryUI,
sort: view.sort,
schema,
primaryDisplay: view.primaryDisplay,
@ -132,12 +133,13 @@ export async function update(ctx: Ctx<UpdateViewRequest, ViewResponse>) {
const { tableId } = view
const schema = await parseSchema(view)
const parsedView: RequiredKeys<Omit<ViewV2, "queryUI">> = {
const parsedView: RequiredKeys<ViewV2> = {
id: view.id,
name: view.name,
version: view.version,
tableId: view.tableId,
query: view.query,
queryUI: view.queryUI,
sort: view.sort,
schema,
primaryDisplay: view.primaryDisplay,

View File

@ -9,7 +9,6 @@ export interface ViewResponseEnriched {
data: ViewV2Enriched
}
export interface CreateViewRequest
extends Omit<ViewV2, "version" | "id" | "queryUI"> {}
export interface CreateViewRequest extends Omit<ViewV2, "version" | "id"> {}
export interface UpdateViewRequest extends Omit<ViewV2, "queryUI"> {}
export interface UpdateViewRequest extends ViewV2 {}