From cf96e5a34fb494f5433ccead5ab153b55e254d82 Mon Sep 17 00:00:00 2001 From: breeg554 Date: Thu, 9 Jan 2025 16:36:51 +0100 Subject: [PATCH] handle list and map in metadata --- apps/api/lib/buildel/blocks/chat.ex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/api/lib/buildel/blocks/chat.ex b/apps/api/lib/buildel/blocks/chat.ex index 9f2caabd..f26180a3 100644 --- a/apps/api/lib/buildel/blocks/chat.ex +++ b/apps/api/lib/buildel/blocks/chat.ex @@ -867,6 +867,12 @@ defmodule Buildel.Blocks.Chat do {key, value}, acc when is_binary(value) -> String.replace(acc, "{{#{key}}}", value |> to_string()) + {key, value}, acc when is_map(value) -> + Jason.encode!(value) + + {key, value}, acc when is_list(value) -> + Jason.encode!(value) + _, acc -> acc end)