Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

NOISSUE - Fix sdk page metadata from email to identity. #77

Merged
merged 4 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var cmdUsers = []cobra.Command{
return
}
pageMetadata := mgxsdk.PageMetadata{
Email: Email,
Identity: Identity,
Offset: Offset,
Limit: Limit,
Metadata: metadata,
Expand Down
4 changes: 2 additions & 2 deletions cli/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var (
Offset uint64 = 0
// Name query parameter.
Name string = ""
// Email query parameter.
Email string = ""
// Identity query parameter.
Identity string = ""
// Metadata query parameter.
Metadata string = ""
// Status query parameter.
Expand Down
8 changes: 4 additions & 4 deletions cmd/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ func main() {
)

rootCmd.PersistentFlags().StringVarP(
&cli.Email,
"email",
"e",
&cli.Identity,
"identity",
ianmuchyri marked this conversation as resolved.
Show resolved Hide resolved
"I",
"",
"User email query parameter",
"User identity query parameter",
)

rootCmd.PersistentFlags().StringVarP(
Expand Down
7 changes: 4 additions & 3 deletions pkg/sdk/go/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type PageMetadata struct {
Offset uint64 `json:"offset"`
Limit uint64 `json:"limit"`
Level uint64 `json:"level,omitempty"`
Email string `json:"email,omitempty"`
Identity string `json:"identity,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
Expand All @@ -91,6 +91,7 @@ type PageMetadata struct {
Topic string `json:"topic,omitempty"`
Contact string `json:"contact,omitempty"`
State string `json:"state,omitempty"`
Order string `json:"order,omitempty"`
}

// Credentials represent client credentials: it contains
Expand Down Expand Up @@ -1186,8 +1187,8 @@ func (pm PageMetadata) query() (string, error) {
if pm.Level != 0 {
q.Add("level", strconv.FormatUint(pm.Level, 10))
}
if pm.Email != "" {
q.Add("email", pm.Email)
if pm.Identity != "" {
q.Add("identity", pm.Identity)
}
if pm.Name != "" {
q.Add("name", pm.Name)
Expand Down
2 changes: 1 addition & 1 deletion provision/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func New(cfg Config, sdk sdk.SDK, logger mglog.Logger) Service {
// Mapping retrieves current configuration.
func (ps *provisionService) Mapping(token string) (map[string]interface{}, error) {
userFilter := sdk.PageMetadata{
Email: "",
Identity: "",
Offset: uint64(offset),
Limit: uint64(limit),
Metadata: make(map[string]interface{}),
Expand Down
Loading