fix query

This commit is contained in:
Nam Huynh 2021-08-19 15:37:47 +07:00
parent 942c45a95c
commit 80bbe7cedb
1 changed files with 1 additions and 1 deletions

View File

@ -10,7 +10,7 @@ import (
func (s Service) findByDeviceID(ctx context.Context, id string) (result Device) {
stm, args, _ := s.Builder.Select("*").From(TableDeviceMngt).Where("device_id = ?", id).ToSql()
if err := s.DB.SelectContext(ctx, &result, stm, args...); err != nil {
if err := s.DB.QueryRowContext(ctx, stm, args...).Scan(&result); err != nil {
logger.Error("devicemngt - findByDeviceID", logger.LogData{
"device_id": id,
"error": err.Error(),