Using fauna shell this works right:
Update(Select("ref",Get(Function("verify_user"))), {
body:
Query(
Lambda(
["account", "verified"],
Update(
Select(["ref"], Get(Match(Index("unique_User_account"), Var("account")))),
{ data: { isVerified: Var("verified") } }
)
)
)
})
However trying to update same funciton through JS driver gives me an error:
await client.query(
q.Update(q.Select('ref', q.Get(Function('verify_user'))), {
name: 'verify_user',
body: q.Query(
q.Lambda(
['account', 'verified'],
q.Update(
q.Select(
['ref'],
q.Get(
q.Match(q.Index('unique_User_account'), q.Var('account'))
)
),
{ data: { isVerified: q.Var('verified') } }
)
)
),
})
)
[InvalidValue: Provided Function must take at least 1 argument.] {
description: undefined
}
Any hints?