Files
bigcapital/server/src/services/DynamicListing/HasDynamicListing.js
Ahmed Bouhuolia a22c8395f3 feat: remove path alias.
feat: remove Webpack and depend on nodemon.
feat: refactoring expenses.
feat: optimize system users with caching.
feat: architecture tenant optimize.
2020-09-15 00:51:39 +02:00

22 lines
531 B
JavaScript

import { DYNAMIC_LISTING_ERRORS } from 'services/DynamicListing/DynamicListing';
export const dynamicListingErrorsToResponse = (error) => {
let _errors;
if (error.message === DYNAMIC_LISTING_ERRORS.LOGIC_INVALID) {
_errors.push({
type: DYNAMIC_LISTING_ERRORS.LOGIC_INVALID,
code: 200,
});
}
if (
error.message ===
DYNAMIC_LISTING_ERRORS.RESOURCE_HAS_NO_FIELDS
) {
_errors.push({
type: DYNAMIC_LISTING_ERRORS.RESOURCE_HAS_NO_FIELDS,
code: 300,
});
}
return _errors;
};