fastn icon indicating copy to clipboard operation
fastn copied to clipboard

can not set the value of a field of record in functions

Open amitu opened this issue 2 years ago • 0 comments

-- record form:
string title:

-- form $f:
title: some title


-- ftd.text-input:
value: $f.title
$on-input$: $set_title($f=$f, value=$VALUE)

-- void set_title(f, value):
form $f:
string value:

f.title = value

Expected Behavior

The value of .title should be updated.

Current Behavior

Crashes with:

thread 'actix-server worker 3' panicked at fastn-js/src/ssr.rs:22:48:
called `Result::unwrap()` on an `Err` value: Exception(String("SyntaxError: invalid redefinition of lexical identifier"))

Possible Solution

Fix it?

Steps to Reproduce (for bugs)

Code snippet included above.

Context

Trying to do form handling.

Your Environment

  • fastn Version (I.e, output of fastn -v): 0.4.7
  • Operating System: Mac
  • Web Browser: Safari

amitu avatar Nov 29 '23 06:11 amitu