Compare commits

..

3 Commits

Author SHA1 Message Date
ddc115f4a8 change SaleOrderProduct store type 2023-09-08 12:38:23 +07:00
12aa1f94b9 use abstraction response 2023-09-08 12:38:02 +07:00
a3039a8cc7 fix type 2023-09-08 12:37:39 +07:00
3 changed files with 5 additions and 5 deletions

View File

@ -60,7 +60,7 @@ func (server *Server) renewAccessToken(ctx *gin.Context) {
} }
if time.Now().After(refreshPayload.ExpiredAt) { if time.Now().After(refreshPayload.ExpiredAt) {
err := fmt.Errorf("Exprired session") err := fmt.Errorf("Expired session")
ctx.JSON(http.StatusUnauthorized, errorResponse(err, "")) ctx.JSON(http.StatusUnauthorized, errorResponse(err, ""))
return return
} }

View File

@ -177,10 +177,10 @@ func (server *Server) loginUser(ctx *gin.Context) {
RefreshTokenExpiresAt: refreshTokenPayload.ExpiredAt, RefreshTokenExpiresAt: refreshTokenPayload.ExpiredAt,
} }
res := userLoginResponse{ res := BaseApiRespond("succes", userLoginResponse{
UserTokenResponse: tokenResponse, UserTokenResponse: tokenResponse,
UserMerchantResponse: newUserMerchantResponse(user), UserMerchantResponse: newUserMerchantResponse(user),
} })
ctx.JSON(http.StatusOK, res) ctx.JSON(http.StatusOK, res)
} }

View File

@ -10,8 +10,8 @@ import (
) )
type SaleOrderProduct struct { type SaleOrderProduct struct {
ProductID uuid.UUID `json:"product_id"` ProductID uuid.UUID `json:"id"`
ProductName string `json:"product_name"` ProductName string `json:"name"`
Quantity float64 `json:"quantity"` Quantity float64 `json:"quantity"`
Sub_total float64 `json:"sub_total"` Sub_total float64 `json:"sub_total"`
Price float64 `json:"price"` Price float64 `json:"price"`