FIX: Don't load all groups when rendering <GroupChooser /> (#31271)

In a few places throughout the app, when we render the `<GroupChooser
/>` component, we fetch the full groups list of the site from the
`/groups/search` endpoint. This is wasteful because the full groups list
is already included in the preloaded data that's sent to the client app
on the initial page load, so we can just use this preloaded list for
`<GroupChooser />` and we can avoid making an HTTP request.

Internal topic: t/147297.
This commit is contained in:
Osama Sayegh
2025-02-11 21:32:02 +03:00
committed by GitHub
parent 3e056b5127
commit 4db3389f3d
7 changed files with 57 additions and 54 deletions

View File

@@ -288,6 +288,11 @@
"string",
"null"
]
},
"automatic": {
"type": [
"boolean"
]
}
},
"required": [
@@ -295,7 +300,8 @@
"name",
"flair_url",
"flair_bg_color",
"flair_color"
"flair_color",
"automatic"
]
}
},