Rename ATTACHMENT to ATTACHMENTS

This commit is contained in:
Adria Navarro 2024-04-03 11:02:25 +02:00
parent 757284d6c0
commit aabee4d90e
5 changed files with 5 additions and 5 deletions

View File

@ -394,7 +394,7 @@
FIELDS.BIGINT, FIELDS.BIGINT,
FIELDS.BOOLEAN, FIELDS.BOOLEAN,
FIELDS.DATETIME, FIELDS.DATETIME,
FIELDS.ATTACHMENT, FIELDS.ATTACHMENTS,
FIELDS.ATTACHMENT_SINGLE, FIELDS.ATTACHMENT_SINGLE,
FIELDS.LINK, FIELDS.LINK,
FIELDS.FORMULA, FIELDS.FORMULA,

View File

@ -107,7 +107,7 @@ export const FIELDS = {
}, },
}, },
}, },
ATTACHMENT: { ATTACHMENTS: {
name: "Attachment List", name: "Attachment List",
type: FieldType.ATTACHMENTS, type: FieldType.ATTACHMENTS,
icon: "Folder", icon: "Folder",

View File

@ -192,7 +192,7 @@ const parseType = (value, type) => {
} }
// Parse attachments, treating no elements as null // Parse attachments, treating no elements as null
if (type === FieldTypes.ATTACHMENT) { if (type === FieldTypes.ATTACHMENTS) {
if (!Array.isArray(value) || !value.length) { if (!Array.isArray(value) || !value.length) {
return null return null
} }

View File

@ -99,7 +99,7 @@ export async function checkForColumnUpdates(
column.subtype !== oldTable?.schema[column.name]?.subtype column.subtype !== oldTable?.schema[column.name]?.subtype
) )
for (const attachmentColumn of changedAttachmentSubtypeColumns) { 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 ??= {} attachmentColumn.constraints.length ??= {}
attachmentColumn.constraints.length.maximum = 1 attachmentColumn.constraints.length.maximum = 1

View File

@ -48,7 +48,7 @@ export const FieldTypeSubtypes = {
USER: FieldSubtype.USER as FieldSubtype.USER, USER: FieldSubtype.USER as FieldSubtype.USER,
USERS: FieldSubtype.USERS as FieldSubtype.USERS, USERS: FieldSubtype.USERS as FieldSubtype.USERS,
}, },
ATTACHMENT: { ATTACHMENTS: {
SINGLE: FieldSubtype.SINGLE as FieldSubtype.SINGLE, SINGLE: FieldSubtype.SINGLE as FieldSubtype.SINGLE,
}, },
} }