FEATURE: New route for loading multiple user cards simultaneously (#9078)

Introduces `/user-cards.json`

Also allows the client-side user model to be passed an existing promise when loading, so that multiple models can share the same AJAX request
This commit is contained in:
David Taylor
2020-03-06 12:23:22 +00:00
committed by GitHub
parent 29ccdf5d35
commit ff62911a89
4 changed files with 59 additions and 1 deletions

View File

@ -536,8 +536,12 @@ const User = RestModel.extend({
const user = this;
return PreloadStore.getAndRemove(`user_${user.get("username")}`, () => {
const useCardRoute = options && options.forCard;
if (options && options.existingRequest) {
// Existing ajax request has been passed, use it
return options.existingRequest;
}
const useCardRoute = options && options.forCard;
if (options) delete options.forCard;
const path = useCardRoute