add more info to info for scope (#3913)
This commit is contained in:
parent
49ad32f45e
commit
111f46581f
2 changed files with 14 additions and 0 deletions
|
@ -102,6 +102,7 @@ impl InfoStructure for DefineScopeStatement {
|
|||
signup,
|
||||
signin,
|
||||
comment,
|
||||
session,
|
||||
..
|
||||
} = self;
|
||||
let mut acc = Object::default();
|
||||
|
@ -120,6 +121,10 @@ impl InfoStructure for DefineScopeStatement {
|
|||
acc.insert("comment".to_string(), comment.into());
|
||||
}
|
||||
|
||||
if let Some(duration) = session {
|
||||
acc.insert("duration".to_string(), duration.into());
|
||||
}
|
||||
|
||||
Value::Object(acc)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -348,6 +348,15 @@ impl InfoStatement {
|
|||
"tokens".to_owned(),
|
||||
process_arr(run.all_sc_tokens(opt.ns(), opt.db(), sc).await?),
|
||||
);
|
||||
|
||||
let def = run.get_sc(opt.ns(), opt.db(), sc).await?;
|
||||
let Value::Object(o) = def.structure() else {
|
||||
return Err(Error::Thrown(
|
||||
"InfoStructure should return Value::Object".to_string(),
|
||||
));
|
||||
};
|
||||
res.extend(o);
|
||||
|
||||
// Ok all good
|
||||
Value::from(res).ok()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue