Skip to content

Commit

Permalink
feat: add ApprovedBy field
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtyf committed Mar 18, 2024
1 parent 542121e commit 493d539
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions backend/src/server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ func handleGetAllServiceRequest(client *mongo.Client) http.Handler {

func handleGetServiceRequest(mongoClient *mongo.Client, psqlClient *sql.DB) http.Handler {
type ResponseBodySteps struct {
Name string `json:"name"`
Status models.EventType `json:"status"`
UpdatedAt time.Time `json:"updated_at"`
Name string `json:"name"`
Status models.EventType `json:"status"`
UpdatedAt time.Time `json:"updated_at"`
ApprovedBy string `json:"approved_by"`
}
type ResponseBody struct {
ServiceRequest *models.ServiceRequestModel `json:"service_request"`
Expand All @@ -78,9 +79,10 @@ func handleGetServiceRequest(mongoClient *mongo.Client, psqlClient *sql.DB) http
steps := make([]ResponseBodySteps, 0, len(sre))
for _, event := range sre {
steps = append(steps, ResponseBodySteps{
Name: event.StepName,
Status: event.EventType,
UpdatedAt: event.CreatedAt,
Name: event.StepName,
Status: event.EventType,
UpdatedAt: event.CreatedAt,
ApprovedBy: event.ApprovedBy,
})
}
response := ResponseBody{
Expand Down

0 comments on commit 493d539

Please sign in to comment.