mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user