def direct3
cswap-bend-cli@0.1.0.0 · switch.bend:36
import cswap-bend-cli@0.1.0.0/switch.bend as Switch
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/act.bend as Act
import cswap-bend-cli@0.1.0.0/swbase.bend as B
import cswap-bend-cli@0.1.0.0/swlive.bend as L
import cswap-bend-cli@0.1.0.0/store/base.bend as SBase
import cswap-bend-cli@0.1.0.0/store/seq.bend as SSeq
36def direct3(+ctx: SBase.Ctx, +seq: Json.Json, +n: String, +force: Bool, +opts: L.Opts, +rec: Maybe<&2, Json.Json>) -> Act.of(Json.Json):
37 match rec:
38 case None{}:
39 Act.fail(Json.Json, B.e_not_found(), "Account-" ++ n ++ " does not exist")
40 case Some{r}:
41 do ActM<Json.Json>:
42 l : L.Live <- L.read_live(ctx)
43 direct4(Bool.not(force) && String.eq(SSeq.str_or(L.lv_slot(l, seq), ""), n), ctx, n, force, opts, SSeq.field_str(r, "email"))