refactor(backend): naming-convention
This commit is contained in:
parent
14e1508d00
commit
7a286f5650
23 changed files with 78 additions and 62 deletions
|
@ -1,4 +1,4 @@
|
|||
import { EnvVars, getEnvVar } from '../util/envvars.js';
|
||||
import { envVars, getEnvVar } from '../util/envVars.js';
|
||||
|
||||
type FrontendIdpConfig = {
|
||||
authority: string;
|
||||
|
@ -18,14 +18,14 @@ const RESPONSE_TYPE = 'code';
|
|||
export function getFrontendAuthConfig(): FrontendAuthConfig {
|
||||
return {
|
||||
student: {
|
||||
authority: getEnvVar(EnvVars.IdpStudentUrl),
|
||||
clientId: getEnvVar(EnvVars.IdpStudentClientId),
|
||||
authority: getEnvVar(envVars.IdpStudentUrl),
|
||||
clientId: getEnvVar(envVars.IdpStudentClientId),
|
||||
scope: SCOPE,
|
||||
responseType: RESPONSE_TYPE,
|
||||
},
|
||||
teacher: {
|
||||
authority: getEnvVar(EnvVars.IdpTeacherUrl),
|
||||
clientId: getEnvVar(EnvVars.IdpTeacherClientId),
|
||||
authority: getEnvVar(envVars.IdpTeacherUrl),
|
||||
clientId: getEnvVar(envVars.IdpTeacherClientId),
|
||||
scope: SCOPE,
|
||||
responseType: RESPONSE_TYPE,
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Request, Response } from 'express';
|
|||
import { FALLBACK_LANG } from '../config.js';
|
||||
import { FilteredLearningObject, LearningObjectIdentifier, LearningPathIdentifier } from '../interfaces/learning-content.js';
|
||||
import learningObjectService from '../services/learning-objects/learning-object-service.js';
|
||||
import { EnvVars, getEnvVar } from '../util/envvars.js';
|
||||
import { envVars, getEnvVar } from '../util/envVars.js';
|
||||
import { Language } from '../entities/content/language.js';
|
||||
import { BadRequestException } from '../exceptions.js';
|
||||
import attachmentService from '../services/learning-objects/attachment-service.js';
|
||||
|
@ -14,7 +14,7 @@ function getLearningObjectIdentifierFromRequest(req: Request): LearningObjectIde
|
|||
}
|
||||
return {
|
||||
hruid: req.params.hruid as string,
|
||||
language: (req.query.language || getEnvVar(EnvVars.FallbackLanguage)) as Language,
|
||||
language: (req.query.language || getEnvVar(envVars.FallbackLanguage)) as Language,
|
||||
version: parseInt(req.query.version as string),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ export async function getUserHandler<T extends User>(req: Request, res: Response
|
|||
}
|
||||
}
|
||||
|
||||
export async function createUserHandler<T extends User>(req: Request, res: Response, service: UserService<T>, UserClass: new () => T) {
|
||||
export async function createUserHandler<T extends User>(req: Request, res: Response, service: UserService<T>, userClass: new () => T) {
|
||||
try {
|
||||
getLogger().debug({ req: req });
|
||||
const userData = req.body as UserDTO;
|
||||
|
@ -59,7 +59,7 @@ export async function createUserHandler<T extends User>(req: Request, res: Respo
|
|||
return;
|
||||
}
|
||||
|
||||
const newUser = await service.createUser(userData, UserClass);
|
||||
const newUser = await service.createUser(userData, userClass);
|
||||
res.status(201).json(newUser);
|
||||
} catch (error) {
|
||||
getLogger().error('❌ Error creating user:', error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue