Skip to content

Commit 6da97d3

Browse files
committed
Merge pull request #124 from ParsePlatform/fosco.redirectClassNameForKey
Updated query result handling to fix querying for unfetched relations
2 parents 1851264 + a126fa2 commit 6da97d3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ParseQuery.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@ export default class ParseQuery {
277277
findOptions
278278
).then((response) => {
279279
return response.results.map((data) => {
280-
data.className = this.className;
280+
if (!data.className) {
281+
data.className = this.className;
282+
}
281283
return ParseObject.fromJSON(data);
282284
});
283285
})._thenRunCallbacks(options);
@@ -373,7 +375,9 @@ export default class ParseQuery {
373375
if (!objects[0]) {
374376
return undefined;
375377
}
376-
objects[0].className = this.className;
378+
if (!objects[0].className) {
379+
objects[0].className = this.className;
380+
}
377381
return ParseObject.fromJSON(objects[0]);
378382
})._thenRunCallbacks(options);
379383
}

0 commit comments

Comments
 (0)