Skip to content

Commit

Permalink
fix type with transactionquery
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwalguptaofficial committed Feb 16, 2024
1 parent 37d06b0 commit 6df518b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/common/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface IIntersectQuery {
order?: IOrderQuery;
}

export interface ITranscationQuery {
export interface ITransactionQuery {
tables: string[];
method: string;
data?: any;
Expand Down
6 changes: 3 additions & 3 deletions src/main/connection.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ConnectionHelper } from "./connection_helper";
import {
ISelectQuery, ICountQuery, IInsertQuery, SetQuery,
IUpdateQuery, IRemoveQuery, ITranscationQuery,
IUpdateQuery, IRemoveQuery, ITransactionQuery,
API, IDataBase, EVENT, IPlugin, IIntersectQuery, IDbInfo, TMiddleware, promiseResolve, InitDbResult
} from "../common";
import { JsStoreMap } from "./map";
Expand Down Expand Up @@ -236,11 +236,11 @@ export class Connection extends ConnectionHelper {
* execute transaction
*
* @template T
* @param {ITranscationQuery} query
* @param {ITransactionQuery} query
* @returns
* @memberof Connection
*/
transaction<T>(query: ITranscationQuery) {
transaction<T>(query: ITransactionQuery) {
return this.pushApi<T>({
name: API.Transaction,
query: query
Expand Down
8 changes: 4 additions & 4 deletions src/worker/executors/transaction/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Base } from "@executors/base";
import { ITranscationQuery, WebWorkerRequest, ERROR_TYPE, API, WebWorkerResult, promise } from "@/common";
import { ITransactionQuery, WebWorkerRequest, ERROR_TYPE, API, WebWorkerResult, promise } from "@/common";
import { IDBUtil } from "@worker/idbutil";
import { promiseReject, LogHelper, variableFromPath } from "@worker/utils";
import { Insert } from "@executors/insert";
Expand All @@ -22,7 +22,7 @@ export class Transaction extends Base {

beforeExecute: () => Promise<void>;

constructor(qry: ITranscationQuery, util: IDBUtil) {
constructor(qry: ITransactionQuery, util: IDBUtil) {
super();
this.query = qry as any;
this.util = util;
Expand All @@ -47,7 +47,7 @@ export class Transaction extends Base {
}

validate() {
const query: ITranscationQuery = this.query as any;
const query: ITransactionQuery = this.query as any;
const notExistingTable = this.notExistingTable_(query.tables);
if (notExistingTable) {
return new LogHelper(ERROR_TYPE.TableNotExist, { tableName: notExistingTable });
Expand All @@ -60,7 +60,7 @@ export class Transaction extends Base {
}

private startExecution_() {
const query: ITranscationQuery = this.query as any;
const query: ITransactionQuery = this.query as any;
const createPusher = (api: any) => {
return (qry) => {
return this.pushReq_({
Expand Down

0 comments on commit 6df518b

Please sign in to comment.