mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: remove Webpack and depend on nodemon. feat: refactoring expenses. feat: optimize system users with caching. feat: architecture tenant optimize.
22 lines
531 B
JavaScript
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;
|
|
}; |