Browse Source

bugfix & cleanup

tsMigration
Nareshkumar Rao 3 years ago
parent
commit
06a3f97ee7
  1. 12
      .eslintrc.js
  2. 2
      src/db/utils.ts
  3. 4
      src/routes/CodeRoute.ts
  4. 4
      src/routes/VerifyRoute.ts

12
.eslintrc.js

@ -1,12 +0,0 @@
module.exports = {
env: {
node: true,
commonjs: true,
es2021: true,
},
extends: "eslint:recommended",
parserOptions: {
ecmaVersion: 12,
},
rules: {},
};

2
src/db/utils.ts

@ -9,7 +9,7 @@ export function addContact(
): void {
User.findOne({ where: { telegram: userATelegram } }).then((userA) => {
User.findOne({ where: { id: userBRowID } }).then((userB) => {
if (!!userA || !!userB) {
if (!userA || !userB) {
done(false, "Could not find user.");
return;
}

4
src/routes/CodeRoute.ts

@ -21,7 +21,7 @@ export function CodeRoute(req: Request, res: Response) {
function createQRCode(
telegram: TelegramID,
callback: (errorMessage: string, url?: string) => void
callback: (errorMessage: string | Error, url?: string) => void
): void {
User.findOne({
where: {
@ -38,7 +38,7 @@ function createQRCode(
verifyURL,
{ width: 300, height: 300 } as QRCodeToDataURLOptions,
(error, url) => {
callback(error.message, url);
callback(error, url);
}
);
});

4
src/routes/VerifyRoute.ts

@ -45,6 +45,4 @@ function checkVerification(
callback(false, "No such verification");
}
});
}
exports.VerifyRoute = VerifyRoute;
}
Loading…
Cancel
Save