Updated permanentDelete to receive user context as the first argument (#26884)
Co-authored-by: Ezekiel <ezekielchow94@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
a6aa92d149
Коммит
5746bb8df3
@@ -90,15 +90,12 @@ func (s *SearchUserStore) Save(rctx request.CTX, user *model.User) (*model.User,
|
||||
return nuser, err
|
||||
}
|
||||
|
||||
func (s *SearchUserStore) PermanentDelete(userId string) error {
|
||||
// TODO: Use the actuall request context from the App layer
|
||||
// https://mattermost.atlassian.net/browse/MM-55738
|
||||
rctx := request.EmptyContext(s.rootStore.Logger())
|
||||
func (s *SearchUserStore) PermanentDelete(rctx request.CTX, userId string) error {
|
||||
user, userErr := s.UserStore.Get(context.Background(), userId)
|
||||
if userErr != nil {
|
||||
rctx.Logger().Warn("Encountered error deleting user", mlog.String("user_id", userId), mlog.Err(userErr))
|
||||
}
|
||||
err := s.UserStore.PermanentDelete(userId)
|
||||
err := s.UserStore.PermanentDelete(rctx, userId)
|
||||
if err == nil && userErr == nil {
|
||||
s.deleteUserIndex(rctx, user)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user