Skip to content

Commit

Permalink
fix : fix chat room lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeCP17 committed Oct 1, 2024
1 parent a1c2148 commit bee2ca4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/server/handler/chat_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func (h ChatHandler) CreateRoom(c echo.Context) error {
}
var createRoomRequest domain.CreateRoomRequest

if err := pnd.ParseBody(c, &createRoomRequest); err != nil {
return c.JSON(err.StatusCode, err)
if bodyError := pnd.ParseBody(c, &createRoomRequest); bodyError != nil {
return c.JSON(bodyError.StatusCode, err)
}

res, err := h.chatService.CreateRoom(
Expand Down
6 changes: 4 additions & 2 deletions internal/service/chat_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ func NewChatService(conn *database.DB) *ChatService {
}
}

func (s *ChatService) CreateRoom(ctx context.Context, name, roomType string, userFirebaseUID string) (
func (s *ChatService) CreateRoom(
ctx context.Context, name, roomType, userFirebaseUID string,
) (
*chat.RoomSimpleInfo, *pnd.AppError,
) {
userData, err := databasegen.New(s.conn).FindUser(ctx, databasegen.FindUserParams{
Expand All @@ -35,7 +37,7 @@ func (s *ChatService) CreateRoom(ctx context.Context, name, roomType string, use
tx, transactionError := s.conn.BeginTx(ctx)
defer tx.Rollback()

if err != nil {
if transactionError != nil {
return nil, transactionError
}

Expand Down

0 comments on commit bee2ca4

Please sign in to comment.