Skip to content
Merged
Changes from all commits
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
5 changes: 3 additions & 2 deletions server/src/api/devices/cards/cardApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ export function registerEndpoints(app: express.Application) {
if (typeof universityID !== "string") { return res.status(400).json({ error: "universityID was not a string" }).send(); }
if (typeof cardTag !== "string") { return res.status(400).json({ error: "cardTag was not a string" }).send(); }

const username = await Atrium.getRitEmailByUID(CurrencySource.Store, universityID);
if (username === undefined) {
const email = await Atrium.getRitEmailByUID(CurrencySource.Store, universityID);
if (email === undefined) {
return res.status(404).json({ error: "No user found with the given universityID" }).send();
}
const username = email.split("@")[0];

const user = await UserRepo.getUserByRitUsername(username);
if (user === undefined) {
Expand Down
Loading