Skip to content

Commit

Permalink
chore: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
innocenzi committed Sep 23, 2024
1 parent 190d8a0 commit eef34e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export async function registerContextUpdater(context: HybridlyContext) {
async function updateRoutes() {
log.appendLine('Collecting routes...')
const routes = JSON.parse(execSync('php artisan route:list --json', { cwd: context.cwd }).toString()) as Route[]
const result = routes.map(async (route) => {
const result = await Promise.all(routes.map(async (route) => {
const controller = await actionToLink(context.uri, route.action)

if (!controller) {
Expand All @@ -171,9 +171,9 @@ export async function registerContextUpdater(context: HybridlyContext) {
...route,
controller,
} as Route
})
}))

context.routes = (await Promise.all(result)).filter(Boolean) as Route[]
context.routes = result.filter(Boolean) as Route[]

log.appendLine(`Collected ${context.routes.length} routes.`)
}
Expand Down

0 comments on commit eef34e1

Please sign in to comment.