Skip to content

Commit

Permalink
Savepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
nkonev committed Nov 23, 2023
1 parent cc46597 commit 9b26f52
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions event/graph/schema.resolvers.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func (r *subscriptionResolver) UserAccountEvents(ctx context.Context, userIds []
switch typedEvent := event.(type) {
case dto.UserAccountEventGroup:
if typedEvent.ForRoleUser != nil && utils.Contains(userIds, typedEvent.UserId) {
var anEvent = convertUserAccountEvent(typedEvent)
var anEvent = convertUserAccountEvent(typedEvent.EventType, typedEvent.ForRoleUser)
cam <- anEvent
}
break
Expand Down Expand Up @@ -296,20 +296,19 @@ type subscriptionResolver struct{ *Resolver }
// - When renaming or deleting a resolver the old code will be put in here. You can safely delete
// it when you're done.
// - You have helper methods in this file. Move them out to keep these resolver files clean.
func convertUserAccountEvent(event dto.UserAccountEventGroup) *model.UserAccountEvent {
func convertUserAccountEvent(eventType string, forRoleUser *dto.UserAccount) *model.UserAccountEvent {
ret := model.UserAccountEvent{}
ret.EventType = event.EventType
ret.EventType = eventType

userAccount := event.ForRoleUser
if userAccount != nil {
if forRoleUser != nil {
ret.UserAccountEvent = &model.UserAccountDto{
ID: userAccount.Id,
Login: userAccount.Login,
Avatar: userAccount.Avatar,
AvatarBig: userAccount.AvatarBig,
ShortInfo: userAccount.ShortInfo,
LastLoginDateTime: userAccount.LastLoginDateTime,
Oauth2Identifiers: convertOauth2Identifiers(userAccount.Oauth2Identifiers),
ID: forRoleUser.Id,
Login: forRoleUser.Login,
Avatar: forRoleUser.Avatar,
AvatarBig: forRoleUser.AvatarBig,
ShortInfo: forRoleUser.ShortInfo,
LastLoginDateTime: forRoleUser.LastLoginDateTime,
Oauth2Identifiers: convertOauth2Identifiers(forRoleUser.Oauth2Identifiers),
}
}

Expand Down

0 comments on commit 9b26f52

Please sign in to comment.