MM-43144: Add teams loader (#19960)
```release-note NONE ``` Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
16b1cbd6e3
Коммит
7f0d1cf0dd
@@ -303,3 +303,12 @@ func getChannelsLoader(ctx context.Context) (*dataloader.Loader, error) {
|
||||
}
|
||||
return l, nil
|
||||
}
|
||||
|
||||
// getTeamsLoader returns the teams loader out of the context.
|
||||
func getTeamsLoader(ctx context.Context) (*dataloader.Loader, error) {
|
||||
l, ok := ctx.Value(teamsLoaderCtx).(*dataloader.Loader)
|
||||
if !ok {
|
||||
return nil, errors.New("no dataloader.Loader found in context")
|
||||
}
|
||||
return l, nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user