Skip to content

Commit bc82cda

Browse files
Copilothotlong
andcommitted
Fix delete method implementation and naming collisions
- Fixed ObjectQL.delete() to return boolean directly from driver - Removed incorrect comment about driver returning record/null - Fixed MockDriver.delete() to return boolean per DriverInterface spec - Renamed QueryFilter/QueryOptions to DataEngineFilter/DataEngineQueryOptions to avoid naming collisions with existing data protocol types - All tests passing Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent a59cd2e commit bc82cda

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/objectql/src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,7 @@ export class ObjectQL implements IDataEngine {
398398
hookContext.result = result;
399399
await this.triggerHooks('afterDelete', hookContext);
400400

401-
// Return boolean - true if deletion was successful
402-
// The driver.delete should return the deleted record or null
403-
return hookContext.result !== null && hookContext.result !== undefined;
401+
// Driver.delete() already returns boolean per DriverInterface spec
402+
return hookContext.result;
404403
}
405404
}

test-dataengine-interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class MockDriver {
4848

4949
async delete(object: string, id: any) {
5050
console.log(`[MockDriver] delete(${object}, ${id})`);
51-
return { id };
51+
return true; // Return boolean as per DriverInterface
5252
}
5353
}
5454

0 commit comments

Comments
 (0)