diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 2701c30359..615ea73f54 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -394,7 +394,7 @@ FIELDS.BIGINT, FIELDS.BOOLEAN, FIELDS.DATETIME, - FIELDS.ATTACHMENT, + FIELDS.ATTACHMENTS, FIELDS.ATTACHMENT_SINGLE, FIELDS.LINK, FIELDS.FORMULA, diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js index d88637d670..bafecae074 100644 --- a/packages/builder/src/constants/backend/index.js +++ b/packages/builder/src/constants/backend/index.js @@ -107,7 +107,7 @@ export const FIELDS = { }, }, }, - ATTACHMENT: { + ATTACHMENTS: { name: "Attachment List", type: FieldType.ATTACHMENTS, icon: "Folder", diff --git a/packages/client/src/components/app/forms/validation.js b/packages/client/src/components/app/forms/validation.js index 3b3a5d6e1d..cdedd85cf2 100644 --- a/packages/client/src/components/app/forms/validation.js +++ b/packages/client/src/components/app/forms/validation.js @@ -192,7 +192,7 @@ const parseType = (value, type) => { } // Parse attachments, treating no elements as null - if (type === FieldTypes.ATTACHMENT) { + if (type === FieldTypes.ATTACHMENTS) { if (!Array.isArray(value) || !value.length) { return null } diff --git a/packages/server/src/api/controllers/table/utils.ts b/packages/server/src/api/controllers/table/utils.ts index 1dea1a09f9..0611a7ae0d 100644 --- a/packages/server/src/api/controllers/table/utils.ts +++ b/packages/server/src/api/controllers/table/utils.ts @@ -99,7 +99,7 @@ export async function checkForColumnUpdates( column.subtype !== oldTable?.schema[column.name]?.subtype ) for (const attachmentColumn of changedAttachmentSubtypeColumns) { - if (attachmentColumn.subtype === FieldTypeSubtypes.ATTACHMENT.SINGLE) { + if (attachmentColumn.subtype === FieldTypeSubtypes.ATTACHMENTS.SINGLE) { attachmentColumn.constraints ??= { length: {} } attachmentColumn.constraints.length ??= {} attachmentColumn.constraints.length.maximum = 1 diff --git a/packages/types/src/documents/app/row.ts b/packages/types/src/documents/app/row.ts index 27daec1df1..b17aececd7 100644 --- a/packages/types/src/documents/app/row.ts +++ b/packages/types/src/documents/app/row.ts @@ -48,7 +48,7 @@ export const FieldTypeSubtypes = { USER: FieldSubtype.USER as FieldSubtype.USER, USERS: FieldSubtype.USERS as FieldSubtype.USERS, }, - ATTACHMENT: { + ATTACHMENTS: { SINGLE: FieldSubtype.SINGLE as FieldSubtype.SINGLE, }, }