Skip to content

Commit

Permalink
Ensure unsaved custom packages have the fallback box ID of 0 when sen…
Browse files Browse the repository at this point in the history
…t to the backend
  • Loading branch information
rachelmcr committed Nov 28, 2024
1 parent 64bd83e commit 83226e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extension ShippingLabelPackageSelected: Encodable {
var container = encoder.container(keyedBy: CodingKeys.self)

try container.encode(id, forKey: .id)
try container.encode(boxID, forKey: .boxID)
try container.encode(boxID.isEmpty ? "0" : boxID, forKey: .boxID)
try container.encode(length, forKey: .length)
try container.encode(width, forKey: .width)
try container.encode(height, forKey: .height)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final class WooShippingAddCustomPackageViewModel: ObservableObject {
}

private var packageDataFromCurrentData: WooShippingPackageDataRepresentable {
return WooShippingPackageData(id: UUID().uuidString,
return WooShippingPackageData(id: packageTemplateName,
name: packageTemplateName,
length: fieldValues[.length] ?? "",
width: fieldValues[.width] ?? "",
Expand Down

0 comments on commit 83226e1

Please sign in to comment.