summaryrefslogtreecommitdiff
path: root/node_modules/@jet-app/app-store/tmp/src/common/search/web-search-action.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@jet-app/app-store/tmp/src/common/search/web-search-action.js')
-rw-r--r--node_modules/@jet-app/app-store/tmp/src/common/search/web-search-action.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/node_modules/@jet-app/app-store/tmp/src/common/search/web-search-action.js b/node_modules/@jet-app/app-store/tmp/src/common/search/web-search-action.js
new file mode 100644
index 0000000..28c0491
--- /dev/null
+++ b/node_modules/@jet-app/app-store/tmp/src/common/search/web-search-action.js
@@ -0,0 +1,23 @@
+import { FlowAction } from "../../api/models";
+import { makeSearchResultsPageIntent, } from "../../api/intents/search-results-page-intent";
+import { getLocale } from "../locale";
+import { makeCanonicalSearchResultsPageUrl } from "./search-page-url";
+/**
+ * Creates a `FlowAction` destined for the search results page
+ *
+ * This will be used by the "web" client to perform search from the search landing page,
+ * or to change the platform on search results page
+ */
+export function makeWebSearchAction(objectGraph, platform, term = "") {
+ const searchAction = new FlowAction("search");
+ const destination = makeSearchResultsPageIntent({
+ ...getLocale(objectGraph),
+ platform,
+ term,
+ origin: "externalUrl",
+ });
+ searchAction.destination = destination;
+ searchAction.pageUrl = makeCanonicalSearchResultsPageUrl(objectGraph, destination);
+ return searchAction;
+}
+//# sourceMappingURL=web-search-action.js.map \ No newline at end of file