mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
create local file when create view with type doc
This commit is contained in:
@ -114,6 +114,10 @@ pub fn ast_to_event_render_ctx(ast: &Vec<EventASTContext>) -> Vec<EventRenderCon
|
||||
Some(ref event_output) => Some(event_output.get_ident().unwrap().to_string()),
|
||||
None => None,
|
||||
};
|
||||
// eprintln!(
|
||||
// "😁 {:?} / {:?}",
|
||||
// event_ast.event_input, event_ast.event_output
|
||||
// );
|
||||
|
||||
return EventRenderContext {
|
||||
input_deserializer,
|
||||
|
@ -44,8 +44,14 @@ impl EventTemplate {
|
||||
Some(ref input) => self.tera_context.insert("input_deserializer", input),
|
||||
}
|
||||
|
||||
self.tera_context
|
||||
.insert("has_output", &ctx.output_deserializer.is_some());
|
||||
// eprintln!(
|
||||
// "😁 {:?} / {:?}",
|
||||
// &ctx.input_deserializer, &ctx.output_deserializer
|
||||
// );
|
||||
|
||||
let has_output = ctx.output_deserializer.is_some();
|
||||
self.tera_context.insert("has_output", &has_output);
|
||||
|
||||
match ctx.output_deserializer {
|
||||
None => self.tera_context.insert("output_deserializer", "Unit"),
|
||||
Some(ref output) => self.tera_context.insert("output_deserializer", output),
|
||||
|
@ -19,8 +19,13 @@ class {{ event_class }} {
|
||||
|
||||
return Dispatch.asyncRequest(request)
|
||||
.then((bytesResult) => bytesResult.fold(
|
||||
(okBytes) => left({{ output_deserializer }}.fromBuffer(okBytes)),
|
||||
(errBytes) => right({{ error_deserializer }}.fromBuffer(errBytes)),
|
||||
|
||||
{%- if has_output %}
|
||||
(okBytes) => left({{ output_deserializer }}.fromBuffer(okBytes)),
|
||||
{%- else %}
|
||||
(bytes) => left(unit),
|
||||
{%- endif %}
|
||||
(errBytes) => right({{ error_deserializer }}.fromBuffer(errBytes)),
|
||||
));
|
||||
|
||||
{%- else %}
|
||||
|
Reference in New Issue
Block a user