File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ function isManagedCloud(host: string): boolean {
16
16
) ;
17
17
}
18
18
19
- export function featuresForHost ( host : string ) : TriggerFeatures {
19
+ function featuresForHost ( host : string ) : TriggerFeatures {
20
20
return {
21
21
isManagedCloud : isManagedCloud ( host ) ,
22
22
v3Enabled : env . V3_ENABLED === "true" ,
@@ -26,12 +26,9 @@ export function featuresForHost(host: string): TriggerFeatures {
26
26
27
27
export function featuresForRequest ( request : Request ) : TriggerFeatures {
28
28
const url = requestUrl ( request ) ;
29
-
30
- return featuresForHost ( url . host ) ;
29
+ return featuresForUrl ( url ) ;
31
30
}
32
31
33
- export function featuresForUrl ( urlString : string ) : TriggerFeatures {
34
- const url = new URL ( urlString ) ;
35
-
32
+ export function featuresForUrl ( url : URL ) : TriggerFeatures {
36
33
return featuresForHost ( url . host ) ;
37
34
}
Original file line number Diff line number Diff line change @@ -8,11 +8,10 @@ import type {
8
8
import { customAlphabet } from "nanoid" ;
9
9
import slug from "slug" ;
10
10
import { prisma , PrismaClientOrTransaction } from "~/db.server" ;
11
- import { createProject } from "./project.server" ;
12
11
import { generate } from "random-words" ;
13
12
import { createApiKeyForEnv , createPkApiKeyForEnv , envSlug } from "./api-key.server" ;
14
13
import { env } from "~/env.server" ;
15
- import { featuresForHost } from "~/features.server" ;
14
+ import { featuresForUrl } from "~/features.server" ;
16
15
17
16
export type { Organization } ;
18
17
@@ -53,7 +52,7 @@ export async function createOrganization(
53
52
) ;
54
53
}
55
54
56
- const features = featuresForHost ( env . APP_ORIGIN ) ;
55
+ const features = featuresForUrl ( new URL ( env . APP_ORIGIN ) ) ;
57
56
58
57
const organization = await prisma . organization . create ( {
59
58
data : {
You can’t perform that action at this time.
0 commit comments