Skip to content

Commit

Permalink
Merge pull request #91 from Avanade/sprint-32
Browse files Browse the repository at this point in the history
Sprint 32
  • Loading branch information
iibuan authored Sep 10, 2024
2 parents 3c49df3 + 3031085 commit fdda339
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 25 deletions.
30 changes: 17 additions & 13 deletions src/goapp/routes/pages/approvals/myapprovals.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,23 @@ func MyApprovalsHandler(w http.ResponseWriter, r *http.Request) {
}
}

paramsApplication := make(map[string]interface{})
paramsApplication["Id"] = items[0]["ApplicationId"]

application, err := db.ExecuteStoredProcedureWithResult("PR_Applications_Select_ById", paramsApplication)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
} else {
if len(application) > 0 {
if application[0]["ExportUrl"] != nil {
homeData.ExportUrl = application[0]["ExportUrl"].(string)
}
if application[0]["OrganizationTypeUrl"] != nil {
homeData.OrganizationTypeUrl = application[0]["OrganizationTypeUrl"].(string)
if items != nil {
if items[0]["ApplicationId"] != nil {
paramsApplication := make(map[string]interface{})
paramsApplication["Id"] = items[0]["ApplicationId"]

application, err := db.ExecuteStoredProcedureWithResult("PR_Applications_Select_ById", paramsApplication)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
} else {
if len(application) > 0 {
if application[0]["ExportUrl"] != nil {
homeData.ExportUrl = application[0]["ExportUrl"].(string)
}
if application[0]["OrganizationTypeUrl"] != nil {
homeData.OrganizationTypeUrl = application[0]["OrganizationTypeUrl"].(string)
}
}
}
}
}
Expand Down
28 changes: 16 additions & 12 deletions src/goapp/routes/pages/approvals/myrequests.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,23 @@ func MyRequestsHandler(w http.ResponseWriter, r *http.Request) {
}
}

paramsApplication := make(map[string]interface{})
paramsApplication["Id"] = items[0]["ApplicationId"]
if items != nil {
if items[0]["ApplicationId"] != nil {
paramsApplication := make(map[string]interface{})
paramsApplication["Id"] = items[0]["ApplicationId"]

application, err := db.ExecuteStoredProcedureWithResult("PR_Applications_Select_ById", paramsApplication)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
} else {
if len(application) > 0 {
if application[0]["ExportUrl"] != nil {
homeData.ExportUrl = application[0]["ExportUrl"].(string)
}
if application[0]["OrganizationTypeUrl"] != nil {
homeData.OrganizationTypeUrl = application[0]["OrganizationTypeUrl"].(string)
application, err := db.ExecuteStoredProcedureWithResult("PR_Applications_Select_ById", paramsApplication)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
} else {
if len(application) > 0 {
if application[0]["ExportUrl"] != nil {
homeData.ExportUrl = application[0]["ExportUrl"].(string)
}
if application[0]["OrganizationTypeUrl"] != nil {
homeData.OrganizationTypeUrl = application[0]["OrganizationTypeUrl"].(string)
}
}
}
}
}
Expand Down

0 comments on commit fdda339

Please sign in to comment.