Don't persist the view as doc
This commit is contained in:
parent
d6121d1504
commit
21e17053c6
|
@ -62,9 +62,6 @@ describe("/v2/views", () => {
|
||||||
...newView,
|
...newView,
|
||||||
id: expect.any(String),
|
id: expect.any(String),
|
||||||
version: 2,
|
version: 2,
|
||||||
_id: expect.any(String),
|
|
||||||
createdAt: expect.any(String),
|
|
||||||
updatedAt: expect.any(String),
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -81,9 +78,6 @@ describe("/v2/views", () => {
|
||||||
...viewFilters,
|
...viewFilters,
|
||||||
id: expect.any(String),
|
id: expect.any(String),
|
||||||
version: 2,
|
version: 2,
|
||||||
_id: expect.any(String),
|
|
||||||
createdAt: expect.any(String),
|
|
||||||
updatedAt: expect.any(String),
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -13,12 +13,8 @@ export async function create(
|
||||||
id: coreUtils.newid(),
|
id: coreUtils.newid(),
|
||||||
version: 2,
|
version: 2,
|
||||||
}
|
}
|
||||||
view._id = view.id
|
|
||||||
|
|
||||||
const db = context.getAppDB()
|
const db = context.getAppDB()
|
||||||
|
|
||||||
await db.put(view, {})
|
|
||||||
|
|
||||||
const table = await sdk.tables.getTable(tableId)
|
const table = await sdk.tables.getTable(tableId)
|
||||||
table.views ??= {}
|
table.views ??= {}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,4 @@ export interface ViewResponse {
|
||||||
data: ViewV2
|
data: ViewV2
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CreateViewRequest = Omit<
|
export type CreateViewRequest = Omit<ViewV2, "version" | "id">
|
||||||
ViewV2,
|
|
||||||
"_id" | "_rev" | "createdAt" | "updatedAt" | "version" | "id"
|
|
||||||
>
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ export interface View {
|
||||||
meta?: Record<string, any>
|
meta?: Record<string, any>
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ViewV2 extends Document {
|
export interface ViewV2 {
|
||||||
version: 2
|
version: 2
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
|
|
Loading…
Reference in New Issue