iOS: Shop nur am Nicht-Einzelstück; QR-Fehler nennt den Server
- „Gekauft bei" (Shop) gehoert bei Einzelstuecken zum einzelnen Stueck, nicht ans Modell. Wie im Web wird der Shop-Picker am Produkt jetzt ausgeblendet, sobald „Einzelstuecke" aktiv ist; der Produktlink (beschreibt das Produkt allgemein) bleibt. Beim Speichern wird fuer Einzelstuecke kein Shop ans Modell geschrieben. - Wird ein gescanntes Einzelstueck nicht gefunden, nennt die Meldung jetzt den abgefragten Server und den Original-Fehler. So ist sofort erkennbar, ob der aktive Server ein anderer ist als der im QR-Code (haeufigste Ursache bei korrekter UID) oder ob ein Netz-/Serverfehler vorliegt. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -95,10 +95,16 @@ struct ProductDetailView: View {
|
||||
}
|
||||
|
||||
if current.isObject {
|
||||
Section("Gekauft bei") {
|
||||
Picker("Shop", selection: $shopId) {
|
||||
Text("– unbekannt / mehrere –").tag(Int?.none)
|
||||
ForEach(shops) { shop in Text(shop.name).tag(Int?.some(shop.id)) }
|
||||
// „Gekauft bei" gehört bei Einzelstücken zum einzelnen Stück
|
||||
// (jedes kann woanders gekauft sein), nicht ans Modell – wie im
|
||||
// Web wird der Shop hier dann ausgeblendet. Der Produktlink
|
||||
// beschreibt das Produkt allgemein und bleibt.
|
||||
Section(current.isIndividual ? "Produktlink" : "Gekauft bei") {
|
||||
if !current.isIndividual {
|
||||
Picker("Shop", selection: $shopId) {
|
||||
Text("– unbekannt / mehrere –").tag(Int?.none)
|
||||
ForEach(shops) { shop in Text(shop.name).tag(Int?.some(shop.id)) }
|
||||
}
|
||||
}
|
||||
LabeledField(label: "Produktlink", text: $productUrl)
|
||||
if !productUrl.isEmpty, let url = URL(string: productUrl) {
|
||||
@@ -256,7 +262,8 @@ struct ProductDetailView: View {
|
||||
brand: brand.isEmpty ? nil : brand,
|
||||
packageSize: nil, packageLabel: nil, datePrecision: nil,
|
||||
groupId: nil, categoryId: categoryId,
|
||||
shopId: shopId,
|
||||
// Einzelstücke tragen den Shop je Stück – nichts ans Modell.
|
||||
shopId: current.isIndividual ? nil : shopId,
|
||||
productUrl: productUrl.isEmpty ? nil : productUrl,
|
||||
fieldValues: fv
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user