Skip to content

Commit a5df6c7

Browse files
maxymczechMaksym Shcherban
and
Maksym Shcherban
authored
Fix firestore adapter reference options order (#612)
Co-authored-by: Maksym Shcherban <shchema1@fel.cvut.cz>
1 parent 47b1fe6 commit a5df6c7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

addon/adapters/firestore.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,6 @@ const queryOptionsToQueryFn = (options?:QueryOptions) => (collectionRef:firestor
271271
const runWhereOp = ([field, op, value]:WhereOp) => ref = ref.where(field, op, value);
272272
if (isWhereOp(options.where)) { runWhereOp(options.where) } else { options.where.forEach(runWhereOp) }
273273
}
274-
if (options.endAt) { ref = ref.endAt(options.endAt) }
275-
if (options.endBefore) { ref = ref.endBefore(options.endBefore) }
276-
if (options.startAt) { ref = ref.startAt(options.startAt) }
277-
if (options.startAfter) { ref = ref.startAt(options.startAfter) }
278274
if (options.orderBy) {
279275
if (typeof options.orderBy === "string") {
280276
ref = ref.orderBy(options.orderBy)
@@ -284,6 +280,10 @@ const queryOptionsToQueryFn = (options?:QueryOptions) => (collectionRef:firestor
284280
});
285281
}
286282
}
283+
if (options.endAt) { ref = ref.endAt(options.endAt) }
284+
if (options.endBefore) { ref = ref.endBefore(options.endBefore) }
285+
if (options.startAt) { ref = ref.startAt(options.startAt) }
286+
if (options.startAfter) { ref = ref.startAfter(options.startAfter) }
287287
if (options.limit) { ref = ref.limit(options.limit) }
288288
}
289289
return ref;

0 commit comments

Comments
 (0)