Clean types
This commit is contained in:
parent
2be14deb01
commit
24aec6efb1
|
@ -60,10 +60,10 @@ function generateSchema(
|
|||
case FieldType.OPTIONS:
|
||||
case FieldType.LONGFORM:
|
||||
case FieldType.BARCODEQR:
|
||||
case FieldType.BB_REFERENCE_SINGLE:
|
||||
schema.text(key)
|
||||
break
|
||||
case FieldType.BB_REFERENCE:
|
||||
case FieldType.BB_REFERENCE_SINGLE: {
|
||||
case FieldType.BB_REFERENCE: {
|
||||
const subtype = column.subtype
|
||||
switch (subtype) {
|
||||
case BBReferenceFieldSubType.USER:
|
||||
|
|
|
@ -17,7 +17,7 @@ export function processInputBBReferences(
|
|||
export function processInputBBReferences(
|
||||
value: string | string[] | { _id: string } | { _id: string }[],
|
||||
type: FieldType.BB_REFERENCE,
|
||||
subtype: BBReferenceFieldSubType.USER | BBReferenceFieldSubType.USERS
|
||||
subtype: BBReferenceFieldSubType
|
||||
): Promise<string | null>
|
||||
|
||||
export async function processInputBBReferences(
|
||||
|
@ -121,7 +121,7 @@ export function processOutputBBReferences(
|
|||
export function processOutputBBReferences(
|
||||
value: string,
|
||||
type: FieldType.BB_REFERENCE,
|
||||
subtype: BBReferenceFieldSubType.USER | BBReferenceFieldSubType.USERS
|
||||
subtype: BBReferenceFieldSubType
|
||||
): Promise<UserReferenceInfo[]>
|
||||
|
||||
export async function processOutputBBReferences(
|
||||
|
|
|
@ -170,7 +170,7 @@ export function parse(rows: Rows, schema: TableSchema): Rows {
|
|||
function isValidBBReference(
|
||||
data: any,
|
||||
type: FieldType.BB_REFERENCE | FieldType.BB_REFERENCE_SINGLE,
|
||||
subtype: BBReferenceFieldSubType.USER | BBReferenceFieldSubType.USERS
|
||||
subtype: BBReferenceFieldSubType
|
||||
): boolean {
|
||||
if (typeof data !== "string") {
|
||||
return false
|
||||
|
|
|
@ -25,8 +25,8 @@ export const getValidOperatorsForType = (
|
|||
subtype?: BBReferenceFieldSubType
|
||||
formulaType?: FormulaType
|
||||
},
|
||||
field: string,
|
||||
datasource: Datasource & { tableId: any }
|
||||
field?: string,
|
||||
datasource?: Datasource & { tableId: any }
|
||||
) => {
|
||||
const Op = OperatorOptions
|
||||
const stringOps = [
|
||||
|
|
|
@ -110,13 +110,13 @@ export interface FormulaFieldMetadata extends BaseFieldSchema {
|
|||
export interface BBReferenceFieldMetadata
|
||||
extends Omit<BaseFieldSchema, "subtype"> {
|
||||
type: FieldType.BB_REFERENCE
|
||||
subtype: BBReferenceFieldSubType.USER | BBReferenceFieldSubType.USERS
|
||||
subtype: BBReferenceFieldSubType
|
||||
relationshipType?: RelationshipType
|
||||
}
|
||||
export interface BBReferenceSingleFieldMetadata
|
||||
extends Omit<BaseFieldSchema, "subtype"> {
|
||||
type: FieldType.BB_REFERENCE_SINGLE
|
||||
subtype: BBReferenceFieldSubType.USER | BBReferenceFieldSubType.USERS
|
||||
subtype: BBReferenceFieldSubType
|
||||
}
|
||||
|
||||
export interface AttachmentFieldMetadata extends BaseFieldSchema {
|
||||
|
|
Loading…
Reference in New Issue