type and controller
This commit is contained in:
parent
88212ff79b
commit
d24785cd69
4 changed files with 7 additions and 5 deletions
|
@ -53,9 +53,11 @@ export async function getQualificationAssignedMembers(req: Request, res: Respons
|
|||
*/
|
||||
export async function createQualification(req: Request, res: Response): Promise<any> {
|
||||
const qualification = req.body.qualification;
|
||||
const description = req.body.description;
|
||||
|
||||
let createQualification: CreateQualificationCommand = {
|
||||
qualification: qualification,
|
||||
description: description,
|
||||
};
|
||||
await QualificationCommandHandler.create(createQualification);
|
||||
|
||||
|
@ -71,10 +73,12 @@ export async function createQualification(req: Request, res: Response): Promise<
|
|||
export async function updateQualification(req: Request, res: Response): Promise<any> {
|
||||
const id = parseInt(req.params.id);
|
||||
const qualification = req.body.qualification;
|
||||
const description = req.body.description;
|
||||
|
||||
let updateQualification: UpdateQualificationCommand = {
|
||||
id: id,
|
||||
qualification: qualification,
|
||||
description: description,
|
||||
};
|
||||
await QualificationCommandHandler.update(updateQualification);
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ export default abstract class CommunicationTypeFactory {
|
|||
return {
|
||||
id: record.id,
|
||||
type: record.type,
|
||||
useColumns: record.useColumns,
|
||||
fields: record.useColumns,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -5,15 +5,13 @@ import CustomRequestException from "../exceptions/customRequestException";
|
|||
export default function errorHandler(err: ExceptionBase | Error, req: Request, res: Response, next: Function) {
|
||||
let status = 500;
|
||||
let msg = "Internal Server Error";
|
||||
let insideError = undefined;
|
||||
|
||||
if (err instanceof CustomRequestException) {
|
||||
status = err.statusCode;
|
||||
msg = err.message;
|
||||
insideError = err.err;
|
||||
}
|
||||
|
||||
console.log("Handler", err, insideError);
|
||||
console.log("Handler", err);
|
||||
|
||||
res.status(status).send(msg);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export interface CommunicationTypeViewModel {
|
||||
id: number;
|
||||
type: string;
|
||||
useColumns: Array<string>;
|
||||
fields: Array<string>;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue