Skip to content

Commit

Permalink
memperbaiki koment
Browse files Browse the repository at this point in the history
  • Loading branch information
RavitaNRL committed Nov 30, 2023
1 parent 605a14d commit 10f507c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/http/handler/ticket_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ func (h *TicketHandler) CreateTicket(c echo.Context) error {
Location string `json:"location"`
Date time.Time `json:"date"`
Price float64 `json:"price"`
Status string `json:"status"`
Quota int `json:"quota"`
Tersisa int `json:"tersisa"`
Tersisa int `json:"tersisa"`
Category string `json:"category"`
}

Expand All @@ -63,6 +64,7 @@ func (h *TicketHandler) CreateTicket(c echo.Context) error {
Location: input.Location,
Date: dateStr, // Assign the formatted date string
Price: int64(input.Price),
Status: input.Status,
Quota: int64(input.Quota),
Tersisa: int64(input.Tersisa),
Category: input.Category,
Expand Down Expand Up @@ -123,6 +125,7 @@ func (h *TicketHandler) UpdateTicket(c echo.Context) error {
Location string `json:"location"`
Date time.Time `json:"date"`
Price float64 `json:"price"`
Status string `json:"status"`
Quota int `json:"quota"`
Category string `json:"category"`
}
Expand All @@ -143,6 +146,7 @@ func (h *TicketHandler) UpdateTicket(c echo.Context) error {
Location: input.Location,
Date: dateStr, // Assign the formatted date string
Price: int64(input.Price), // Convert Price to int64 if needed
Status: input.Status,
Quota: int64(input.Quota), // Convert Quota to int64 if needed
Category: input.Category,
}
Expand Down Expand Up @@ -333,7 +337,7 @@ func (h *TicketHandler) SortTicketByMostExpensive(c echo.Context) error {
})
}

// ticket yang paling banyak dibeli
// ticket yang paling murah
func (h *TicketHandler) SortTicketByCheapest(c echo.Context) error {
sortParam := c.QueryParam("sort")

Expand Down Expand Up @@ -371,4 +375,4 @@ func (h *TicketHandler) SortTicketByMostBought(c echo.Context) error {
return c.JSON(http.StatusOK, map[string]interface{}{
"data": tickets,
})
}
}

0 comments on commit 10f507c

Please sign in to comment.