добавил ручки для фронта

This commit is contained in:
2025-11-30 02:02:11 +03:00
parent da62ea5b98
commit 714844058f
9 changed files with 99 additions and 9 deletions

View File

@@ -47,3 +47,11 @@ func (r *pgRepository) FindMatch(rawName string) (*uuid.UUID, error) {
return &match.ProductID, nil
}
func (r *pgRepository) GetAllMatches() ([]ocr.ProductMatch, error) {
var matches []ocr.ProductMatch
// Preload("Product") загружает связанную сущность товара,
// чтобы мы видели не только ID, но и название товара из каталога.
err := r.db.Preload("Product").Order("updated_at DESC").Find(&matches).Error
return matches, err
}