From 1c07252a07739a27536e610e3eae5ecc1b9e4d25 Mon Sep 17 00:00:00 2001 From: Prev Wong Date: Tue, 2 Apr 2024 19:45:33 +0800 Subject: [PATCH] chore: api --- .../template-settings/shared/EachTemplateSettings.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/site/components/editor-layout/template-settings/shared/EachTemplateSettings.tsx b/site/components/editor-layout/template-settings/shared/EachTemplateSettings.tsx index bfcf7321..2095e986 100644 --- a/site/components/editor-layout/template-settings/shared/EachTemplateSettings.tsx +++ b/site/components/editor-layout/template-settings/shared/EachTemplateSettings.tsx @@ -123,7 +123,9 @@ export const EachTemplateSettings = observer( className="flex-1" value={alias} onCommit={(value) => { - const expr = Parser.parseExpression(value, t.Identifier); + const expr = Parser.parseExpression(value, { + expected: t.Identifier, + }); setAliasValue(expr.name); commitValue( props.template.each?.iterator ?? null, @@ -155,7 +157,9 @@ export const EachTemplateSettings = observer( }); }} onCommit={(value) => { - const expr = Parser.parseExpression(value, t.Identifier); + const expr = Parser.parseExpression(value, { + expected: t.Identifier, + }); setIndexValue(expr.name); commitValue( props.template.each?.iterator ?? null,