Skip to content

Commit

Permalink
fix ngword select
Browse files Browse the repository at this point in the history
  • Loading branch information
tukeJonny committed Oct 30, 2023
1 parent 937e455 commit c06cfdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webapp/go/livecomment_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func getNgwords(c echo.Context) error {
defer tx.Rollback()

var ngWords []*NGWord
if err := tx.SelectContext(ctx, &ngWords, "SELECT * FROM ng_words WHERE user_id = ? AND livestream_id = ?", userId, livestreamId); err != nil {
if err := tx.SelectContext(ctx, &ngWords, "SELECT id, user_id, livestream_id, word FROM ng_words WHERE user_id = ? AND livestream_id = ?", userId, livestreamId); err != nil {
if errors.Is(err, sql.ErrNoRows) {
return c.JSON(http.StatusOK, []*NGWord{})
} else {
Expand Down Expand Up @@ -192,7 +192,7 @@ func postLivecommentHandler(c echo.Context) error {

// スパム判定
var ngwords []*NGWord
if err := tx.SelectContext(ctx, &ngwords, "SELECT * FROM ng_words"); err != nil {
if err := tx.SelectContext(ctx, &ngwords, "SELECT id, user_id, livestream_id, word FROM ng_words"); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, err.Error())
}

Expand Down

0 comments on commit c06cfdb

Please sign in to comment.