Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused codes #142

Merged
merged 1 commit into from
Oct 16, 2024
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
3 changes: 1 addition & 2 deletions src/goapp/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
ev "main/pkg/envvar"
rtAzure "main/routes/login/azure"
rtPages "main/routes/pages"
rtApprovals "main/routes/pages/approvals"
)

func setPageRoutes() {
Expand All @@ -26,7 +25,7 @@ func setApiRoutes() {
httpRouter.POST("/api/process", ctrl.Item.ProcessResponse)
httpRouter.GET("/api/items/type/{type:[0-2]+}/status/{status:[0-3]+}", m.Chain(ctrl.Item.GetItems, m.AzureAuth()))
httpRouter.GET("/api/search/users/{search}", m.Chain(ctrl.User.SearchUserFromActiveDirectory, m.AzureAuth()))
httpRouter.GET("/api/responsereassignedapi/{itemGuid}/{approver}/{ApplicationId}/{ApplicationModuleId}/{ApproveText}/{RejectText}", m.Chain(rtApprovals.ReAssignApproverHandler, m.AzureAuth()))
httpRouter.GET("/api/responsereassignedapi/{itemGuid}/{approver}/{ApplicationId}/{ApplicationModuleId}/{ApproveText}/{RejectText}", m.Chain(ctrl.Item.ReassignItem, m.AzureAuth()))
}

func serve() {
Expand Down
118 changes: 0 additions & 118 deletions src/goapp/routes/pages/approvals/myapprovals.go

This file was deleted.

52 changes: 0 additions & 52 deletions src/goapp/routes/pages/approvals/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,55 +102,3 @@ type TypPostParams struct {
ResponseDate string `json:"responseDate"`
RespondedBy string `json:"respondedBy"`
}
type TypReeassignParams struct {
Id string `json:"Id"`
ApproverEmail string `json:"ApproverEmail"`
Username string `json:"Username"`
ApplicationId string `json:"ApplicationId"`
ApplicationModuleId string `json:"ApplicationModuleId"`
ItemId string `json:"ItemId"`
ApproveText string `json:"ApproveText"`
RejectText string `json:"RejectText"`
}

func PostReassignCallback(userEmail string, user string, itemId string, ApplicationId string, ApplicationModuleId string, ItemId string, ApproveText string, RejectText string) {

db := connectSql()
defer db.Close()

queryParams := map[string]interface{}{
"Id": itemId,
}
res, err := db.ExecuteStoredProcedureWithResult("PR_Items_Select_ById", queryParams)
handleError(err)

ReassignCallbackUrl := res[0]["ReassignCallbackUrl"].(string)
if ReassignCallbackUrl != "" {
postParams := TypReeassignParams{
Id: itemId,
ApproverEmail: userEmail,
Username: user,
ApplicationId: ApplicationId,
ApplicationModuleId: ApplicationModuleId,
ItemId: ItemId,
ApproveText: ApproveText,
RejectText: RejectText,
}

ch2 := make(chan *http.Response)
// var res *http.Response

getHttpPostResponseStatus(ReassignCallbackUrl, postParams, ch2)
res := <-ch2

isCallbackFailed := true
if res != nil {
if res.StatusCode == 200 {
isCallbackFailed = false
}
}
fmt.Println(isCallbackFailed)

}

}
Loading