Skip to content

Commit 68d38c4

Browse files
committed
updated
1 parent ada2836 commit 68d38c4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

controllers/post.controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/gin-gonic/gin"
1111
"github.com/google/uuid"
1212
db "github.com/wpcodevo/golang-postgresql-api/db/sqlc"
13-
"github.com/wpcodevo/golang-postgresql-api/models"
13+
"github.com/wpcodevo/golang-postgresql-api/schemas"
1414
)
1515

1616
type PostController struct {
@@ -23,7 +23,7 @@ func NewPostController(db *db.Queries, ctx context.Context) *PostController {
2323
}
2424

2525
func (ac *PostController) CreatePost(ctx *gin.Context) {
26-
var payload *models.CreatePost
26+
var payload *schemas.CreatePost
2727

2828
if err := ctx.ShouldBindJSON(&payload); err != nil {
2929
ctx.JSON(http.StatusBadRequest, gin.H{"status": "fail", "message": err.Error()})
@@ -51,7 +51,7 @@ func (ac *PostController) CreatePost(ctx *gin.Context) {
5151
}
5252

5353
func (ac *PostController) UpdatePost(ctx *gin.Context) {
54-
var payload *models.UpdatePost
54+
var payload *schemas.UpdatePost
5555
postId := ctx.Param("postId")
5656

5757
if err := ctx.ShouldBindJSON(&payload); err != nil {

models/post.model.go renamed to schemas/post.schema.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package models
1+
package schemas
22

33
type CreatePost struct {
44
Title string `json:"title" binding:"required"`

tmp/main

-134 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)