Skip to content

Commit

Permalink
Fixes queryRecord when used with ref query interface (FirebaseExtende…
Browse files Browse the repository at this point in the history
…d#608)

When using `ref => ref.orderBy` (for instance), the resulting reference responds to `limit` (as it is a method provided by the firestore library).

It's not necessary to check for a `limit` arg as it will simply be ignored. So this commit removes it.
  • Loading branch information
sdhull authored Dec 10, 2020
1 parent a5df6c7 commit be7163c
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion addon/adapters/firestore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ export default class FirestoreAdapter extends DS.Adapter.extend({
return rootCollection(this, type).then((ref:firestore.CollectionReference) => {
const queryOrRef = queryRecordOptionsToQueryFn(options)(ref);
if (isQuery(queryOrRef)) {
if (queryOrRef.limit) { throw "Dont specify limit on queryRecord" }
return queryOrRef.limit(1).get();
} else {
(options as any).id = queryOrRef.id;
Expand Down

0 comments on commit be7163c

Please sign in to comment.