Type DocWritethrough
This commit is contained in:
parent
4b807aa88b
commit
6e7cd5632a
|
@ -1,4 +1,4 @@
|
||||||
import { AnyDocument, Database } from "@budibase/types"
|
import { AnyDocument, Database, Document } from "@budibase/types"
|
||||||
|
|
||||||
import { JobQueue, Queue, createQueue } from "../queue"
|
import { JobQueue, Queue, createQueue } from "../queue"
|
||||||
import * as dbUtils from "../db"
|
import * as dbUtils from "../db"
|
||||||
|
@ -70,7 +70,7 @@ export class DocWritethroughProcessor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DocWritethrough {
|
export class DocWritethrough<T extends Document = Document> {
|
||||||
private db: Database
|
private db: Database
|
||||||
private _docId: string
|
private _docId: string
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ export class DocWritethrough {
|
||||||
return this._docId
|
return this._docId
|
||||||
}
|
}
|
||||||
|
|
||||||
async patch(data: Record<string, any>) {
|
async patch(data: Partial<T>) {
|
||||||
await DocWritethroughProcessor.queue.add({
|
await DocWritethroughProcessor.queue.add({
|
||||||
dbName: this.db.name,
|
dbName: this.db.name,
|
||||||
docId: this.docId,
|
docId: this.docId,
|
||||||
|
|
Loading…
Reference in New Issue