We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e091242 commit 70fc3e0Copy full SHA for 70fc3e0
WooCommerce/Classes/ViewRelated/Search/Order/OrderSearchUICommand.swift
@@ -79,6 +79,18 @@ final class OrderSearchUICommand: SearchUICommand {
79
80
viewController.navigationController?.pushViewController(detailsViewController, animated: true)
81
}
82
+
83
+ /// Removes the `#` from the start of the search keyword, if present.
84
+ ///
85
+ /// This allows searching for an order with `#123` and getting the results for order `123`.
86
+ /// See https://github.com/woocommerce/woocommerce-ios/issues/2506
87
88
+ func sanitize(_ keyword: String) -> String {
89
+ guard keyword.starts(with: "#") else {
90
+ return keyword
91
+ }
92
+ return keyword.removing(at: keyword.startIndex)
93
94
95
96
private extension OrderSearchUICommand {
0 commit comments