Skip to content

Commit

Permalink
fix: use urlType for new API spec
Browse files Browse the repository at this point in the history
  • Loading branch information
ricokahler authored and binoy14 committed Aug 1, 2024
1 parent c45a63e commit f63886b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/sanity/src/_internal/cli/actions/deploy/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export interface UserApplication {
title: string | null
isDefault: boolean | null
appHost: string
urlType: 'internal' | 'external'
createdAt: string
updatedAt: string
externalAppHost: string | null
type: 'studio'
activeDeployment?: ActiveDeployment | null
}
Expand All @@ -65,7 +65,7 @@ export async function getUserApplication({

function createUserApplication(
client: SanityClient,
body: {title?: string; isDefault?: boolean; appHost: string},
body: {title?: string; isDefault?: boolean; appHost: string; urlType: 'internal' | 'external'},
): Promise<UserApplication> {
return client.request({uri: '/user-applications', method: 'POST', body})
}
Expand All @@ -90,7 +90,7 @@ export async function getOrCreateUserApplication({
if (cliConfig?.studioHost) {
return await createUserApplication(client, {
appHost: cliConfig.studioHost,
isDefault: true,
urlType: 'internal',
})
}

Expand All @@ -109,7 +109,11 @@ export async function getOrCreateUserApplication({
// the user to try again until this function returns true
validate: async (appHost: string) => {
try {
const response = await createUserApplication(client, {appHost, isDefault: true})
const response = await createUserApplication(client, {
appHost,
isDefault: true,
urlType: 'internal',
})
resolve(response)
return true
} catch (e) {
Expand Down

0 comments on commit f63886b

Please sign in to comment.