Skip to content

Commit

Permalink
fix(db-ql): fix result-types error;
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Oct 20, 2021
1 parent a6a9533 commit 71f6ee8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion packages/database-ql/src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,17 @@ export class Query {
requestId: res.requestId,
error: res.error,
ok: false,
code: res.code
code: res.code,
updated: undefined,
matched: undefined,
upsertId: undefined
}
}

return {
requestId: res.requestId,
updated: res.data.updated,
matched: res.data.matched,
upsertId: res.data.upsert_id,
ok: true
}
Expand Down
10 changes: 5 additions & 5 deletions packages/database-ql/src/result-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ interface BaseResult {
}

export interface GetRes<T> extends BaseResult {
data?: T[]
data: T[]
total?: number
limit?: number
offset?: number
}

export interface GetOneRes<T> extends BaseResult {
data?: T
data: T
}

export interface UpdateRes extends BaseResult {
updated?: number
matched?: number
upsertId?: number
updated: number
matched: number
upsertId: number
}

export interface AddRes extends BaseResult {
Expand Down

0 comments on commit 71f6ee8

Please sign in to comment.