Migrate changes from other Metamigo repo
This commit is contained in:
parent
8669b09224
commit
27810142b3
11 changed files with 615 additions and 235 deletions
|
|
@ -141,6 +141,27 @@ export const RegisterBotRoute = Helpers.withDefaults({
|
|||
},
|
||||
});
|
||||
|
||||
export const UnverifyBotRoute = Helpers.withDefaults({
|
||||
method: "post",
|
||||
path: "/api/whatsapp/bots/{id}/unverify",
|
||||
options: {
|
||||
description: "Unverify bot",
|
||||
async handler: (request: Hapi.Request, _h: Hapi.ResponseToolkit) {
|
||||
const { id } = request.params;
|
||||
const { whatsappService } = request.services();
|
||||
|
||||
const bot = await whatsappService.findById(id);
|
||||
|
||||
if (bot) {
|
||||
return whatsappService.unverify(bot);
|
||||
}
|
||||
|
||||
throw Boom.notFound("Bot not found");
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
export const RefreshBotRoute = Helpers.withDefaults({
|
||||
method: "get",
|
||||
path: "/api/whatsapp/bots/{id}/refresh",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue