fix query changes field stock logs

This commit is contained in:
giovanni-ce
2025-12-06 22:29:50 +07:00
parent 67f7ec3a40
commit 296e8e4c18
2 changed files with 2 additions and 2 deletions
@@ -30,7 +30,7 @@ func (r *StockLogRepositoryImpl) GetByFlaggable(ctx context.Context, logType str
var stockLogs []*entity.StockLog
err := r.DB().WithContext(ctx).
Where("log_type = ? AND log_id = ?", logType, logId).
Where("loggable_type = ? AND log_id = ?", logType, logId).
Preload("ProductWarehouse").
Preload("ProductWarehouse.Product").
Preload("ProductWarehouse.Warehouse").