Files
bigcapital/packages/server-nest/src/modules/Attachments/_utils.ts
2025-04-06 21:13:46 +02:00

15 lines
398 B
TypeScript

import { ServiceError } from '../Items/ServiceError';
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);
}
};