mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
types(services/sql): explicitly cast return value as type variable T instead of any
previously the type variable was useless, because `const ret = (dbConnection.transaction(func) as any).deferred();` was inferred as "any".
This commit is contained in:
@@ -278,7 +278,7 @@ function transactional<T>(func: (statement: Statement) => T) {
|
|||||||
ws.sendTransactionEntityChangesToAllClients();
|
ws.sendTransactionEntityChangesToAllClients();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret as T;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("Got error ", e);
|
console.warn("Got error ", e);
|
||||||
const entityChangeIds = cls.getAndClearEntityChangeIds();
|
const entityChangeIds = cls.getAndClearEntityChangeIds();
|
||||||
|
|||||||
Reference in New Issue
Block a user