Skip to content

Commit

Permalink
feat: add project resources location
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Mar 5, 2024
1 parent 4f8e50c commit a0ed2d4
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/utils/data.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,25 @@ export async function selectProject(team) {
})
if (isCancel(projectName)) return null
projectName = projectName || defaultProjectName
const projectLocation = await select({
message: 'Resources leader location (for D1 & R2)',
initialValue: 'weur',
options: [
{ label: 'Western Europe', value: 'weur' },
{ label: 'Eastern Europe', value: 'eeur' },
{ label: 'Western North America', value: 'wnam' },
{ label: 'Eastern North America', value: 'enam' },
{ label: 'Asia Pacific', value: 'apac' }
]
})
if (isCancel(projectLocation)) return null
consola.start(`Creating project \`${projectName}\` on NuxtHub and Cloudflare...`)
project = await $api(`/teams/${team.slug}/projects`, {
method: 'POST',
body: { name: projectName }
body: {
name: projectName,
location: projectLocation
}
}).catch((err) => {
if (err.response?._data?.message?.includes('Cloudflare account')) {
consola.warn('You need to link your Cloudflare account to create a project.')
Expand Down

0 comments on commit a0ed2d4

Please sign in to comment.