Skip to content

Commit

Permalink
fix: create url func
Browse files Browse the repository at this point in the history
  • Loading branch information
vinit717 committed Jun 26, 2024
1 parent 6b4767f commit bd3cc06
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions controllers/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,6 @@ func CreateTinyURL(ctx *gin.Context, db *bun.DB) {
return
}

body.CreatedAt = time.Now().UTC()

if _, err := db.NewInsert().Model(&body).Exec(ctx); err != nil {
ctx.JSON(http.StatusInternalServerError, dtos.URLCreationResponse{
Message: "Failed to create tiny URL",
})
return
}

if err := utils.IncrementURLCount(body.UserID, db, ctx); err != nil {
ctx.JSON(http.StatusInternalServerError, dtos.URLCreationResponse{
Message: "Failed to increment URL count: " + err.Error(),
Expand Down

0 comments on commit bd3cc06

Please sign in to comment.