mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 16:51:38 +10:00
fix: additional backwards compat
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
import type { Field } from '@prisma/client';
|
||||
import { type Envelope, type Field } from '@prisma/client';
|
||||
|
||||
import { extractLegacyIds } from '../universal/id';
|
||||
|
||||
/**
|
||||
* Sort the fields by the Y position on the document.
|
||||
@ -63,3 +65,15 @@ export const validateFieldsUninserted = (): boolean => {
|
||||
|
||||
return errorElements.length === 0;
|
||||
};
|
||||
|
||||
export const mapFieldToLegacyField = (
|
||||
field: Field,
|
||||
envelope: Pick<Envelope, 'type' | 'secondaryId'>,
|
||||
) => {
|
||||
const legacyId = extractLegacyIds(envelope);
|
||||
|
||||
return {
|
||||
...field,
|
||||
...legacyId,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user