Skip to content

Commit

Permalink
Merge pull request #5 from vercel-labs/teams
Browse files Browse the repository at this point in the history
refactor: use arrow function
  • Loading branch information
Kikobeats authored Dec 11, 2024
2 parents 75b8131 + cb15760 commit 1e0bf07
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ const vercelApi = (pathname: string) =>
}
})

async function getProjectName (projectId: string, teamId: string) {
return vercelApi(`v9/projects/${projectId}?teamId=${teamId}`)
const getProjectName = async (projectId: string, teamId: string) =>
vercelApi(`v9/projects/${projectId}?teamId=${teamId}`)
.then(res => res.json())
.then((payload: any) => payload.name)
}

const getOrganizationName = async (teamId: string) =>
vercelApi(`v2/teams/${teamId}`)
Expand Down Expand Up @@ -58,11 +57,13 @@ async function fromPath (): Promise<{ org: string; project: string }> {
return { org, project }
}

export async function getSlugAndSection ({
args
}: {
args: string[]
} = { args: [] }): Promise<{
export async function getSlugAndSection (
{
args
}: {
args: string[]
} = { args: [] }
): Promise<{
org: string
project: string
section: string
Expand Down

0 comments on commit 1e0bf07

Please sign in to comment.