feat(server): wip import resources

This commit is contained in:
Ahmed Bouhuolia
2024-03-11 20:05:12 +02:00
parent 90b4f3ef6d
commit 4270d66928
16 changed files with 328 additions and 75 deletions

View File

@@ -169,6 +169,21 @@ export class ImportController extends BaseController {
next: NextFunction
) {
if (error instanceof ServiceError) {
if (error.errorType === 'INVALID_MAP_ATTRS') {
return res.status(400).send({
errors: [{ type: 'INVALID_MAP_ATTRS' }]
});
}
if (error.errorType === 'DUPLICATED_FROM_MAP_ATTR') {
return res.status(400).send({
errors: [{ type: 'DUPLICATED_FROM_MAP_ATTR' }],
});
};
if (error.errorType === 'DUPLICATED_TO_MAP_ATTR') {
return res.status(400).send({
errors: [{ type: 'DUPLICATED_TO_MAP_ATTR' }],
})
}
}
next(error);
}