Files
bigcapital/packages/server/src/services/Attachments/_utils.ts
2024-05-24 19:50:06 +02:00

15 lines
389 B
TypeScript

import { ServiceError } from '@/exceptions';
import { ERRORS } from './constants';
export const validateLinkModelExists = (LinkModel) => {
if (!LinkModel) {
throw new ServiceError(ERRORS.DOCUMENT_LINK_REF_INVALID);
}
};
export const validateLinkModelEntryExists = (foundLinkModel) => {
if (!foundLinkModel) {
throw new ServiceError(ERRORS.DOCUMENT_LINK_ID_INVALID);
}
};