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.
2 parents 90afcdd + f7682a2 commit ca588fcCopy full SHA for ca588fc
apps/admin/src/constants/schemes.ts
@@ -1,3 +1,21 @@
1
+const BASE_SCHEME = 'boolti://';
2
+
3
+interface SchemeOptions {
4
+ path: string;
5
+ query?: Record<string, string | number | boolean | undefined>;
6
+}
7
8
+export function createAppScheme({ path, query }: SchemeOptions) {
9
+ const queryString = query
10
+ ? '?' +
11
+ Object.entries(query)
12
+ .filter(([, v]) => v !== undefined)
13
+ .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`)
14
+ .join('&')
15
+ : '';
16
+ return `${BASE_SCHEME}${path}${queryString}`;
17
18
19
export const SCHEMES = {
- 선물_등록: (giftId: string) => `boolti:///gift/${giftId}`,
20
+ 선물_등록: (giftId: string) => createAppScheme({ path: `gift/${giftId}` }),
21
};
0 commit comments