Skip to content

Commit

Permalink
fix(db-ql): restore the code field in query result
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Oct 14, 2021
1 parent 2f29bfd commit decaeec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
7 changes: 5 additions & 2 deletions packages/database-ql/src/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ export class DocumentReference {
error: res.error,
ok: false,
id: undefined,
insertedCount: undefined
insertedCount: undefined,
code: res.code
}
}

Expand Down Expand Up @@ -186,6 +187,7 @@ export class DocumentReference {
requestId: res.requestId,
error: res.error,
ok: false,
code: res.code
}
}

Expand Down Expand Up @@ -237,7 +239,8 @@ export class DocumentReference {
return {
requestId: res.requestId,
error: res.error,
ok: false
ok: false,
code: res.code
}
}

Expand Down
12 changes: 8 additions & 4 deletions packages/database-ql/src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ export class Query {
error: res.error,
data: res.data,
requestId: res.requestId,
ok: false
ok: false,
code: res.code
}
}

Expand Down Expand Up @@ -605,7 +606,8 @@ export class Query {
requestId: res.requestId,
ok: false,
error: res.error,
total: undefined
total: undefined,
code: res.code
}
}

Expand Down Expand Up @@ -670,7 +672,8 @@ export class Query {
return {
requestId: res.requestId,
error: res.error,
ok: false
ok: false,
code: res.code
}
}

Expand Down Expand Up @@ -719,7 +722,8 @@ export class Query {
requestId: res.requestId,
error: res.error,
ok: false,
deleted: undefined
deleted: undefined,
code: res.code
}
}

Expand Down
3 changes: 0 additions & 3 deletions packages/database-ql/src/result-types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

interface BaseResult {
requestId?: string
/**
* @deprecated This field is deprecated , use `ok` instead
*/
code?: string | number
error?: string
ok?: boolean
Expand Down

0 comments on commit decaeec

Please sign in to comment.