From 27c65ccff29284733bbd0e696ebea41f1ee95b1f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 2 Oct 2024 10:54:17 +0100 Subject: [PATCH] Cleanup --- packages/server/src/utilities/rowProcessor/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/server/src/utilities/rowProcessor/index.ts b/packages/server/src/utilities/rowProcessor/index.ts index 02733759f9..e63750bff9 100644 --- a/packages/server/src/utilities/rowProcessor/index.ts +++ b/packages/server/src/utilities/rowProcessor/index.ts @@ -134,10 +134,10 @@ 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) { - let processed = schema.default - if (typeof processed === "string") { - processed = await processString(schema.default, ctx) - } + const processed = + typeof schema.default === "string" + ? await processString(schema.default, ctx) + : schema.default try { row[key] = coerce(processed, schema.type) } catch (err: any) {