Skip to content

Commit 94d008b

Browse files
committed
fix: Moved code by mistake
1 parent 508bf6e commit 94d008b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

internal/handler/tempApplicationHandler.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,15 @@ func (t *TempApplication) CreateTempApplication(gCtx *gin.Context) {
3131
}
3232

3333
err := t.service.CreateTempApplication(t.ctx, &req)
34-
gCtx.AbortWithStatusJSON(err.Code, err.Message)
3534
if err != nil {
35+
gCtx.AbortWithStatusJSON(err.Code, err.Message)
3636
return
3737
}
3838

3939
smtpClient := gCtx.MustGet("smtp_client").(*mail.SMTPClient)
4040
email := applicationReplyEmail(&req)
4141

42-
if email.Error != nil {
43-
gCtx.JSON(http.StatusInternalServerError, "Something went wrong when creating the reply email.")
44-
}
45-
46-
if err := email.Send(smtpClient); err != nil {
47-
gCtx.JSON(http.StatusInternalServerError, "Something went wrong when sending the reply email.")
48-
}
42+
email.Send(smtpClient)
4943

5044
gCtx.Status(http.StatusCreated)
5145
}

0 commit comments

Comments
 (0)