Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
fix: Show error
Browse files Browse the repository at this point in the history
  • Loading branch information
devkcud committed Nov 22, 2024
1 parent 3bb8366 commit eeddf5b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/controller/http/v1/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ func CreateComponentHandler(ctx *gin.Context) {
func DeleteTrashComponentsHandler(ctx *gin.Context) {
dict := translations.GetTranslation(ctx)

service.Component.ClearTrash(ctx.Keys["auth_user"].(*dto.UserProfile).ID)
if err := service.Component.ClearTrash(ctx.Keys["auth_user"].(*dto.UserProfile).ID); err != nil {
log.Print(err)
ctx.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"error": dict.InternalServerError})
return
}

ctx.JSON(http.StatusOK, gin.H{"message": dict.TrashCleared})
}
Expand Down

0 comments on commit eeddf5b

Please sign in to comment.