Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add license plate lookup page #407

Open
wants to merge 23 commits into
base: production
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding config to api routes
  • Loading branch information
chiaberry committed Jul 3, 2023
commit f52a5108ffaf0b4007fd68dbc2d80a730009437e
9 changes: 9 additions & 0 deletions pages/api/check.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const config = {
api: {
externalResolver: true,
},
}

export default function handler(req, res) {
return res.status(200).json({message:"test check"})
}
19 changes: 12 additions & 7 deletions pages/api/passport.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
export const config = {
api: {
externalResolver: true,
},
}

export default function handler(req, res) {
const userQuery = req.query;
fetch(process.env.PASSPORT_AUTH_ENDPOINT, {
Expand Down Expand Up @@ -25,16 +31,15 @@ export default function handler(req, res) {
// if (form.state.length > 0) {
// queryURL = queryURL + `&vehicle_state=${form.state}`;
// }
fetch(enforcementURL, {
return fetch(enforcementURL, {
headers: {
Authorization: `Bearer ${bearerToken}`,
},
})
.then((response) => response.json())
.then((data) => {
return res.status(200).json(data);
})
.catch((err) => console.error(err));
});
})
.then((response) => response.json())
.then((data) => {
return res.status(200).json(data);
})
.catch((err) => console.error(err));
}
7 changes: 6 additions & 1 deletion pages/residential-parking.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ export default function ResidentialParking({ bearerTokenObj }) {
setLoading(false);
showResult(true);
console.log(data);
setPermitted(data["data"].length > 0)
if (data.data) {
setPermitted(data.data.length > 0)
} else {
setPermitted(false)
}

})
.catch((err) => console.error(err));
};
Expand Down