Skip to content

Commit 8ba6f51

Browse files
committed
Changes based on PR review
1 parent 8e65514 commit 8ba6f51

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

recipe/dashboard/api/utils.go

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ func GetUserForRecipeId(userId string, recipeId string) (user dashboardmodels.Us
6464
userToReturn.FirstName = ""
6565
userToReturn.LastName = ""
6666
userToReturn.Email = response.Email
67-
userToReturn.ThirdParty.Id = response.ThirdParty.ID
68-
userToReturn.ThirdParty.UserId = response.ThirdParty.UserID
67+
userToReturn.ThirdParty = &dashboardmodels.ThirdParty{
68+
Id: response.ThirdParty.ID,
69+
UserId: response.ThirdParty.UserID,
70+
}
6971
}
7072

7173
if userToReturn == (dashboardmodels.UserType{}) {
@@ -77,8 +79,10 @@ func GetUserForRecipeId(userId string, recipeId string) (user dashboardmodels.Us
7779
userToReturn.FirstName = ""
7880
userToReturn.LastName = ""
7981
userToReturn.Email = tpepResponse.Email
80-
userToReturn.ThirdParty.Id = tpepResponse.ThirdParty.ID
81-
userToReturn.ThirdParty.UserId = tpepResponse.ThirdParty.UserID
82+
userToReturn.ThirdParty = &dashboardmodels.ThirdParty{
83+
Id: tpepResponse.ThirdParty.ID,
84+
UserId: tpepResponse.ThirdParty.UserID,
85+
}
8286
}
8387
}
8488
} else if recipeId == passwordless.RECIPE_ID {
@@ -133,9 +137,9 @@ func IsRecipeInitialised(recipeId string) bool {
133137
}
134138

135139
if !isRecipeInitialised {
136-
_, tpepErr := thirdpartyemailpassword.GetRecipeInstanceOrThrowError()
140+
_, err := thirdpartyemailpassword.GetRecipeInstanceOrThrowError()
137141

138-
if tpepErr == nil {
142+
if err == nil {
139143
isRecipeInitialised = true
140144
}
141145
}
@@ -147,9 +151,9 @@ func IsRecipeInitialised(recipeId string) bool {
147151
}
148152

149153
if !isRecipeInitialised {
150-
_, tppErr := thirdpartypasswordless.GetRecipeInstanceOrThrowError()
154+
_, err := thirdpartypasswordless.GetRecipeInstanceOrThrowError()
151155

152-
if tppErr == nil {
156+
if err == nil {
153157
isRecipeInitialised = true
154158
}
155159
}
@@ -161,17 +165,17 @@ func IsRecipeInitialised(recipeId string) bool {
161165
}
162166

163167
if !isRecipeInitialised {
164-
_, tpepErr := thirdpartyemailpassword.GetRecipeInstanceOrThrowError()
168+
_, err := thirdpartyemailpassword.GetRecipeInstanceOrThrowError()
165169

166-
if tpepErr == nil {
170+
if err == nil {
167171
isRecipeInitialised = true
168172
}
169173
}
170174

171175
if !isRecipeInitialised {
172-
_, tpepErr := thirdpartypasswordless.GetRecipeInstanceOrThrowError()
176+
_, err := thirdpartypasswordless.GetRecipeInstanceOrThrowError()
173177

174-
if tpepErr == nil {
178+
if err == nil {
175179
isRecipeInitialised = true
176180
}
177181
}

recipe/dashboard/dashboardmodels/models.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ type OverrideStruct struct {
3131
}
3232

3333
type ThirdParty struct {
34-
Id string `json:"id,omitempty"`
35-
UserId string `json:"userId,omitempty"`
34+
Id string `json:"id"`
35+
UserId string `json:"userId"`
3636
}
3737

3838
type UserType struct {
@@ -41,6 +41,6 @@ type UserType struct {
4141
FirstName string `json:"firstName,omitempty"`
4242
LastName string `json:"lastName,omitempty"`
4343
Email string `json:"email,omitempty"`
44-
ThirdParty ThirdParty `json:"thirdParty,omitempty"`
44+
ThirdParty *ThirdParty `json:"thirdParty,omitempty"`
4545
Phone string `json:"phoneNumber,omitempty"`
4646
}

0 commit comments

Comments
 (0)