Skip to content

Commit 385c761

Browse files
committed
Fix delete/update methods
1 parent 466742e commit 385c761

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/datasource.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,17 @@ export class CosmosDataSource<TData extends { id: string }, TContext = any>
7373
}
7474

7575
async deleteOne(id: string) {
76-
const response = await this.container.item(id).delete();
76+
this.options?.logger?.info(
77+
`CosmosDataSource/deleteOne: deleting id: '${id}'`
78+
);
79+
const response = await this.container.item(id, id).delete<TData>();
7780
return response;
7881
}
7982

8083
async updateOne(updDoc: TData) {
81-
const response = await this.container.item(updDoc.id).replace(updDoc);
84+
const response = await this.container
85+
.item(updDoc.id, updDoc.id)
86+
.replace(updDoc);
8287
return response;
8388
}
8489

0 commit comments

Comments
 (0)