Skip to content

Commit b302a16

Browse files
committed
Don't patch if there is no existing record
1 parent 161a39a commit b302a16

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

dataLayer/harperBridge/ResourceBridge.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,11 @@ export class ResourceBridge extends LMDBBridge {
244244
}
245245
}
246246
}
247-
await (id == undefined ? Table.create(record, context) : Table.patch(record, context));
247+
await (id == undefined
248+
? Table.create(record, context)
249+
: existingRecord
250+
? Table.patch(record, context)
251+
: Table.put(record, context));
248252
keys.push(record[Table.primaryKey]);
249253
}
250254
return {

0 commit comments

Comments
 (0)