woocommerce integration, controllers and handlers ready, evolution api simulator ready
This commit is contained in:
16
src/controllers/conversationState.js
Normal file
16
src/controllers/conversationState.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { handleGetConversationState } from "../handlers/conversationState.js";
|
||||
|
||||
export const makeGetConversationState = (tenantIdOrFn) => async (req, res) => {
|
||||
try {
|
||||
const tenantId = typeof tenantIdOrFn === "function" ? tenantIdOrFn() : tenantIdOrFn;
|
||||
const { status, payload } = await handleGetConversationState({
|
||||
tenantId,
|
||||
chat_id: req.query.chat_id || null,
|
||||
});
|
||||
res.status(status).json(payload);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
res.status(500).json({ ok: false, error: "internal_error" });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user