server: fix distribution url setting

This commit is contained in:
King Kévin 2023-03-31 08:31:14 +02:00
parent 6d2b15329f
commit 2f650428ca
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ def get_part_by_id(id)
part["distributors"] = []
statement = @db.prepare("SELECT distribution.sku AS sku, distributor.name AS name, distributor.product_page AS url FROM distribution LEFT JOIN distributor ON distributor.id = distribution.distributor WHERE distribution.part = ?")
statement.execute(id).each do |distribution|
distribution["url"].gsub!("%s", distribution["sku"])
distribution["url"].gsub!("%s", distribution["sku"]) if distribution["url"]
part["distributors"] << distribution
end
# add inventory