Refactor logger usage and add userRepository module
Replaces custom logger instantiation with a shared logger import across modules and routes. Moves player property and privilege management from authRepository to a new userRepository, expanding userRepository with additional user management functions (ban, unban, preferences, privileges, bans). Updates service and route files to use userRepository where appropriate. Adds new session join route and schema, and utility for UUID formatting.
This commit is contained in:
@@ -17,12 +17,12 @@ router.get("", async (req, res) => {
|
||||
return res.status(200).json(result.data)
|
||||
}
|
||||
if (result.code === 204) {
|
||||
throw new SessionError(404, "Not a valid UUID", req.originalUrl)
|
||||
throw new SessionError(404, undefined, "Not a valid UUID", req.originalUrl)
|
||||
}
|
||||
throw new DefaultError(500, "Unknown error")
|
||||
throw new DefaultError(500, undefined, "Unknown error", req.originalUrl)
|
||||
} catch (err) {
|
||||
const errorMessage = err.message || "Not a valid UUID"
|
||||
throw new SessionError(400, errorMessage, req.originalUrl)
|
||||
throw new SessionError(400, undefined, errorMessage, req.originalUrl)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user