Change query params for connection
MODIFY
src/server/rest/service/ConnectionService.ts
src/server/rest/service/ConnectionService.ts
@@ -71,7 +71,7 @@ export default class ConnectionService {
// Filter
const filteredRequest = ConnectionSecurity.filterConnectionsRequest(req.query);
// Get
- const connections = await ConnectionStorage.getConnectionsByUserId(req.user.tenantID, filteredRequest.userId);
+ const connections = await ConnectionStorage.getConnectionsByUserId(req.user.tenantID, filteredRequest.UserID);
// Filter
ConnectionSecurity.filterConnectionsResponse(connections, req.user);
// Return

MODIFY
src/server/rest/service/security/ConnectionSecurity.ts
src/server/rest/service/security/ConnectionSecurity.ts
@@ -21,7 +21,7 @@ export default class ConnectionSecurity {
public static filterConnectionsRequest(request: any): HttpConnectionsRequest {
const filteredRequest: HttpConnectionsRequest = {
- userId: sanitize(request.userId)
+ UserID: sanitize(request.UserID)
} as HttpConnectionsRequest;
UtilsSecurity.filterSkipAndLimit(request, filteredRequest);
UtilsSecurity.filterSort(request, filteredRequest);

MODIFY
src/storage/mongodb/ConnectionStorage.ts
src/storage/mongodb/ConnectionStorage.ts
@@ -56,12 +56,12 @@ export default class ConnectionStorage {
return connection;
}
- static async getConnectionsByUserId(tenantID: string, userId: string): Promise<DataResult<Connection>> {
+ static async getConnectionsByUserId(tenantID: string, userID: string): Promise<DataResult<Connection>> {
const uniqueTimerID = Logging.traceStart(MODULE_NAME, 'getConnectionsByUserId');
await Utils.checkTenant(tenantID);
const aggregation = [];
aggregation.push({
- $match: { userId: Utils.convertToObjectID(userId) }
+ $match: { userId: Utils.convertToObjectID(userID) }
});
// Convert Object ID to string
DatabaseUtils.pushConvertObjectIDToString(aggregation, 'userId');

MODIFY
src/types/requests/HttpConnectionRequest.ts
src/types/requests/HttpConnectionRequest.ts
import HttpDatabaseRequest from './HttpDatabaseRequest';
export interface HttpConnectionsRequest extends HttpDatabaseRequest {
- userId?: string;
+ UserID?: string;
}

Change query params for connection