Revert backend changes

This commit is contained in:
Andrew Kingston 2024-10-02 15:39:48 +01:00
parent 27c65ccff2
commit 45e708652e
No known key found for this signature in database
2 changed files with 4 additions and 6 deletions

View File

@ -134,10 +134,8 @@ async function processDefaultValues(table: Table, row: Row) {
for (const [key, schema] of Object.entries(table.schema)) {
if ("default" in schema && schema.default != null && row[key] == null) {
const processed =
typeof schema.default === "string"
? await processString(schema.default, ctx)
: schema.default
const processed = await processString(schema.default, ctx)
try {
row[key] = coerce(processed, schema.type)
} catch (err: any) {

View File

@ -53,9 +53,8 @@ const allowDefaultColumnByType: Record<FieldType, boolean> = {
[FieldType.DATETIME]: true,
[FieldType.LONGFORM]: true,
[FieldType.STRING]: true,
[FieldType.OPTIONS]: true,
[FieldType.ARRAY]: true,
[FieldType.OPTIONS]: false,
[FieldType.AUTO]: false,
[FieldType.INTERNAL]: false,
[FieldType.BARCODEQR]: false,
@ -65,6 +64,7 @@ const allowDefaultColumnByType: Record<FieldType, boolean> = {
[FieldType.ATTACHMENTS]: false,
[FieldType.ATTACHMENT_SINGLE]: false,
[FieldType.SIGNATURE_SINGLE]: false,
[FieldType.ARRAY]: false,
[FieldType.LINK]: false,
[FieldType.BB_REFERENCE]: false,
[FieldType.BB_REFERENCE_SINGLE]: false,