feat: Add GET /v3/users/:user route handler

Introduces a new GET route handler for `/v3/users/:user` in `UbiservicesRouteHandler.js`. This handler is currently stubbed and sends an empty response.

Also, refactors anonymous function syntax in `AccountRepository.js` to use arrow functions for consistency.
This commit is contained in:
ibratabian17
2025-06-02 01:12:23 +07:00
parent eee11b0888
commit 77aee28c95
2 changed files with 12 additions and 2 deletions

View File

@@ -80,6 +80,7 @@ class UbiservicesRouteHandler extends RouteHandler {
// Handle user-related requests (stubbed for now)
this.registerPost(app, '/v3/users/:user', this.handlePostUsers);
this.registerGet(app, '/v3/users/:user', this.handleGetUsers);
console.log(`[ROUTE] ${this.name} routes initialized`);
@@ -251,6 +252,15 @@ class UbiservicesRouteHandler extends RouteHandler {
res.send(); // No specific action needed for this stubbed endpoint
}
/**
* Handle user-related requests (stubbed for now)
* @param {Request} req - The request object
* @param {Response} res - The response object
*/
handleGetUsers(req, res) {
res.send(); // No specific action needed for this stubbed endpoint
}
/**
* Handle GET requests for space entities.
* @param {Request} req - The request object

View File

@@ -97,7 +97,7 @@ class AccountRepository {
songsPlayedJson,
favoritesJson
],
function(err) {
(err) => {
if (err) {
this.logger.error(`Error saving account ${account.profileId} to DB:`, err.message);
reject(err);
@@ -243,7 +243,7 @@ class AccountRepository {
async delete(profileId) {
const db = getDb();
return new Promise((resolve, reject) => {
db.run('DELETE FROM user_profiles WHERE profileId = ?', [profileId], function(err) {
db.run('DELETE FROM user_profiles WHERE profileId = ?', [profileId], (err) => {
if (err) {
this.logger.error(`Error deleting account ${profileId} from DB:`, err.message);
reject(err);