Skip to content

Commit 7f07ddd

Browse files
committed
fix(my-queries-storage): adjust types to match the method behavior
1 parent 3f8405a commit 7f07ddd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/my-queries-storage/src/compass-pipeline-storage.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,17 @@ export class CompassPipelineStorage implements PipelineStorage {
3232
return await this.userData.readOne(id);
3333
}
3434

35-
async createOrUpdate(id: string, attributes: SavedPipeline) {
35+
async createOrUpdate(
36+
id: string,
37+
attributes: Omit<SavedPipeline, 'lastModified'>
38+
) {
3639
const pipelineExists = Boolean(await this.userData.readOne(id));
3740
return await (pipelineExists
3841
? this.updateAttributes(id, attributes)
3942
: this.create(attributes));
4043
}
4144

42-
private async create(data: SavedPipeline) {
45+
private async create(data: Omit<SavedPipeline, 'lastModified'>) {
4346
await this.userData.write(data.id, {
4447
...data,
4548
lastModified: Date.now(),

packages/my-queries-storage/src/pipeline-storage.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ export interface PipelineStorage {
55
loadMany(
66
predicate: (arg0: SavedPipeline) => boolean
77
): Promise<SavedPipeline[]>;
8-
createOrUpdate(id: string, attributes: SavedPipeline): Promise<SavedPipeline>;
8+
createOrUpdate(
9+
id: string,
10+
attributes: Omit<SavedPipeline, 'lastModified'>
11+
): Promise<SavedPipeline>;
912
updateAttributes(
1013
id: string,
1114
attributes: Partial<SavedPipeline>

0 commit comments

Comments
 (0)