Skip to content

Commit

Permalink
Fix Vercel API deploy (#97)
Browse files Browse the repository at this point in the history
* Move /api to /server

* Replace /api to /server

* Update pnpm-lock.yaml

* Fix a11y counters not working api
  • Loading branch information
sashachabin authored Dec 3, 2023
1 parent 40eda84 commit 2d0bff8
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts
api/build
server/build
21 changes: 14 additions & 7 deletions client/api/main-page/main-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@ export const MainPageApi = {

getA11yTransportCounters: async () => {
const countA11yUnits = async (type) => {
const units = <Unit[]>await fetchApi(
`${TRANSPORT_API_URL}/api/masstrans/${type}`,
{ dataField: 'data' }
);
return units
.filter(({ accessibility }) => accessibility)
.length;
let units = []

try {
units = <Unit[]>await fetchApi(
`${TRANSPORT_API_URL}/api/masstrans/${type}`,
{ dataField: 'data' }
)

return units
.filter(({ accessibility }) => accessibility)
.length;
} catch (e) {
return 0
}
}

return {
Expand Down
94 changes: 47 additions & 47 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2d0bff8

Please sign in to comment.