mirror of
https://github.com/serty2005/rmser.git
synced 2026-02-05 03:12:34 -06:00
добавил ручки для фронта
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user