1
我試圖清理這個API端點。有什麼方法可以將參數放入模型中?Phoenix解析API參數
def listen conn, %{"messages" => [%{"body" => body, "chatId" => chatId, "chatType" => chatType, "from" => from, "id" => id, "mention" => mention, "participants" => participants, "readReceiptRequested" => readReceiptRequested, "timestamp" => timestamp, "type" => type}]} do
sendMessage chatId, from, body
json conn, 200
end
我得到了「不能調用本地當/ 2匹配內容,稱爲:%{」messages「=> messages}當:erlang.is_list(messages)」爲您的第一個建議 –
確實。只要取下警衛,在那裏就顯得多餘了。 – mudasobwa