Files
payload/src/utilities/getIDType.ts
Dan Ribbens d727fc8e24 feat: validate relationship and upload ids (#1004)
* feat: validate relationship and upload ids

* chore: update fields-relationship test data

* fix: skip FE relationship and upload id validation
2022-08-29 14:57:06 -04:00

9 lines
238 B
TypeScript

import { Field } from '../fields/config/types';
export const getIDType = (idField: Field | null): 'number' | 'text' | 'ObjectID' => {
if (idField) {
return idField.type === 'number' ? 'number' : 'text';
}
return 'ObjectID';
};