about summary refs log tree commit diff
path: root/src/state/queries/video/util.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/queries/video/util.ts')
-rw-r--r--src/state/queries/video/util.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/state/queries/video/util.ts b/src/state/queries/video/util.ts
new file mode 100644
index 000000000..266d8aee3
--- /dev/null
+++ b/src/state/queries/video/util.ts
@@ -0,0 +1,15 @@
+const UPLOAD_ENDPOINT = process.env.EXPO_PUBLIC_VIDEO_ROOT_ENDPOINT ?? ''
+
+export const createVideoEndpointUrl = (
+  route: string,
+  params?: Record<string, string>,
+) => {
+  const url = new URL(`${UPLOAD_ENDPOINT}`)
+  url.pathname = route
+  if (params) {
+    for (const key in params) {
+      url.searchParams.set(key, params[key])
+    }
+  }
+  return url.href
+}