-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(api-gql): use service for admin users (#784)
* refactor(api-gql): use users service and repository * finish * upd
- Loading branch information
Showing
22 changed files
with
891 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package mappers | ||
|
||
import ( | ||
"github.com/twirapp/twir/apps/api-gql/internal/delivery/gql/gqlmodel" | ||
"github.com/twirapp/twir/apps/api-gql/internal/entity" | ||
) | ||
|
||
func UserWithChannelToAdminUser(e entity.UserWithChannel) gqlmodel.TwirAdminUser { | ||
user := gqlmodel.TwirAdminUser{ | ||
ID: e.User.ID, | ||
IsBotAdmin: e.User.IsBotAdmin, | ||
IsBanned: e.User.IsBanned, | ||
APIKey: e.User.ApiKey, | ||
} | ||
|
||
if e.Channel != nil { | ||
user.IsBotEnabled = e.Channel.IsEnabled | ||
user.IsBotModerator = e.Channel.IsBotMod | ||
} | ||
|
||
return user | ||
} |
25 changes: 0 additions & 25 deletions
25
apps/api-gql/internal/delivery/gql/resolvers/admin-badges.reolver.helper.go
This file was deleted.
Oops, something went wrong.
23 changes: 5 additions & 18 deletions
23
apps/api-gql/internal/delivery/gql/resolvers/admin-badges.resolver.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
137 changes: 55 additions & 82 deletions
137
apps/api-gql/internal/delivery/gql/resolvers/admin-users.resolver.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.