fix(zalo): fix pairing channel detection and webhook payload format
Amp-Thread-ID: https://ampcode.com/threads/T-019bc4e0-fcb1-77be-b0b5-0d498f0c7197 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -8,11 +8,10 @@ const pairingIdLabels: Record<string, string> = {
|
||||
telegram: "telegramUserId",
|
||||
discord: "discordUserId",
|
||||
};
|
||||
const requirePairingAdapter = vi.fn((channel: string) => ({
|
||||
const getPairingAdapter = vi.fn((channel: string) => ({
|
||||
idLabel: pairingIdLabels[channel] ?? "userId",
|
||||
}));
|
||||
const listPairingChannels = vi.fn(() => ["telegram", "discord"]);
|
||||
const resolvePairingChannel = vi.fn((raw: string) => raw);
|
||||
|
||||
vi.mock("../pairing/pairing-store.js", () => ({
|
||||
listChannelPairingRequests,
|
||||
@@ -21,9 +20,8 @@ vi.mock("../pairing/pairing-store.js", () => ({
|
||||
|
||||
vi.mock("../channels/plugins/pairing.js", () => ({
|
||||
listPairingChannels,
|
||||
resolvePairingChannel,
|
||||
notifyPairingApproved,
|
||||
requirePairingAdapter,
|
||||
getPairingAdapter,
|
||||
}));
|
||||
|
||||
vi.mock("../config/config.js", () => ({
|
||||
|
||||
Reference in New Issue
Block a user