mirror of
https://github.com/ibratabian17/OpenParty.git
synced 2026-01-15 14:22:54 -03:00
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:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user