Skip to content

Commit

Permalink
Set the response code
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmed3mar authored Jun 23, 2023
1 parent f90b8f8 commit 6911d86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions http/gin_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (r *GinResponse) Success() httpcontract.ResponseSuccess {
}

func (r *GinResponse) Status(code int) httpcontract.ResponseStatus {
return NewGinStatus(r.instance)
return NewGinStatus(r.instance, code)
}

func (r *GinResponse) Writer() http.ResponseWriter {
Expand Down Expand Up @@ -89,8 +89,8 @@ type GinStatus struct {
status int
}

func NewGinStatus(instance *gin.Context) httpcontract.ResponseSuccess {
return &GinStatus{instance, http.StatusOK}
func NewGinStatus(instance *gin.Context, code int) httpcontract.ResponseSuccess {
return &GinStatus{instance, code}
}

func (r *GinStatus) Data(contentType string, data []byte) {
Expand Down

0 comments on commit 6911d86

Please sign in to comment.