Skip to content

Commit 04e9cb6

Browse files
committed
Use correct URL
1 parent 6f92ebc commit 04e9cb6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

WooCommerce/Classes/Routing/ProductDetailRouter.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ final class NativeProductDetailCoordinator {
105105

106106
final class ProductURLProvider {
107107
func adminURL(for product: Product, site: Site) -> URL? {
108-
return site.adminURLWithFallback()?.appendingPathComponent("?page=next-admin&p=/woocommerce/products/edit/\(product.productID)")
108+
guard let base = site.adminURLWithFallback() else { return nil }
109+
let admin = base.appendingPathComponent("wp-admin")
110+
111+
var components = URLComponents(url: admin, resolvingAgainstBaseURL: false)!
112+
components.queryItems = [
113+
URLQueryItem(name: "page", value: "next-admin"),
114+
URLQueryItem(name: "p", value: "/woocommerce/products/edit/\(product.productID)")
115+
]
116+
117+
return components.url
109118
}
110119
}

0 commit comments

Comments
 (0)