Add missing Metamigo changes

This commit is contained in:
Darren Clarke 2023-03-13 16:09:41 +00:00
parent 27810142b3
commit 161f3fcee2
6 changed files with 12 additions and 200 deletions

View file

@ -5,7 +5,8 @@
"author": "Abel Luck <abel@guardianproject.info>",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@digiresilience/montar": "*"
"@digiresilience/montar": "*",
"@digiresilience/metamigo-common": "*"
},
"devDependencies": {
"@babel/core": "7.20.12",

View file

@ -41,13 +41,14 @@ export class WhatsappBotRecordRepository extends RepositoryBase(
);
}
async updateAuthInfo(
async updateVerified(
bot: SavedWhatsappBot,
authInfo: string | undefined
verified: boolean
): Promise<SavedWhatsappBot> {
return this.db.one(
"UPDATE $1 SET (auth_info, is_verified) = ROW($2, true) WHERE id = $3 RETURNING *",
[this.schemaTable, authInfo, bot.id]
"UPDATE $1 SET (is_verified) = ROW($2) WHERE id = $3 RETURNING *",
[this.schemaTable, verified, bot.id]
);
}
}