1
0
Fork 0
mirror of synced 2024-10-03 19:43:32 +13:00

Don't persist the view as doc

This commit is contained in:
Adria Navarro 2023-07-19 15:53:22 +02:00
parent d6121d1504
commit 21e17053c6
4 changed files with 2 additions and 15 deletions

View file

@ -62,9 +62,6 @@ describe("/v2/views", () => {
...newView,
id: expect.any(String),
version: 2,
_id: expect.any(String),
createdAt: expect.any(String),
updatedAt: expect.any(String),
})
})
@ -81,9 +78,6 @@ describe("/v2/views", () => {
...viewFilters,
id: expect.any(String),
version: 2,
_id: expect.any(String),
createdAt: expect.any(String),
updatedAt: expect.any(String),
})
})
})

View file

@ -13,12 +13,8 @@ export async function create(
id: coreUtils.newid(),
version: 2,
}
view._id = view.id
const db = context.getAppDB()
await db.put(view, {})
const table = await sdk.tables.getTable(tableId)
table.views ??= {}

View file

@ -4,7 +4,4 @@ export interface ViewResponse {
data: ViewV2
}
export type CreateViewRequest = Omit<
ViewV2,
"_id" | "_rev" | "createdAt" | "updatedAt" | "version" | "id"
>
export type CreateViewRequest = Omit<ViewV2, "version" | "id">

View file

@ -14,7 +14,7 @@ export interface View {
meta?: Record<string, any>
}
export interface ViewV2 extends Document {
export interface ViewV2 {
version: 2
id: string
name: string