Skip to content

Commit

Permalink
style: Remove redundant comments and adjust layout in public.html
Browse files Browse the repository at this point in the history
  • Loading branch information
wajeht committed Sep 7, 2024
1 parent 7c9f5fb commit c44706f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
rateLimitMiddleware,
sessionMiddleware,
} from './middleware';

import ejs from 'ejs';
import cors from 'cors';
import path from 'node:path';
Expand Down
5 changes: 2 additions & 3 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { verifyApiKey } from './utils';
import { NotFoundError } from './error';
import rateLimit from 'express-rate-limit';
import connectRedisStore from 'connect-redis';
import { sessionConfig, appConfig } from './config';
import rateLimitRedisStore from 'rate-limit-redis';
import { sessionConfig, appConfig } from './config';
import { validationResult } from 'express-validator';
import { NextFunction, Request, Response } from 'express';

Expand Down Expand Up @@ -106,8 +106,6 @@ export const validateRequestMiddleware = (schemas: any) => {
return acc;
}, {});

console.log(errors);

// Note: is this a good idea? maybe we jus disable a toast since we already all errors state.input?
// req.flash('error', Object.values(reshapedErrors));
req.session.errors = reshapedErrors;
Expand Down Expand Up @@ -200,6 +198,7 @@ export async function appLocalStateMiddleware(req: Request, res: Response, next:

res.locals.state['unread_apps_notification_count'] = unread_apps_notification_count;

// adding unread notification counts and channel counts to app id layout
const appIdMatch = req.path.match(/^\/apps\/(\d+)/);
if (appIdMatch && req.method === 'GET') {
// @ts-expect-error
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export type Env = 'production' | 'development' | 'testing';

declare module 'express-session' {
interface SessionData {
user?: User;
Expand All @@ -17,6 +15,8 @@ declare global {
}
}

export type Env = 'production' | 'development' | 'testing';

export type ApiKeyPayload = {
appId: string;
userId: string;
Expand Down
1 change: 1 addition & 0 deletions src/views/layouts/public.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<%- include('../components/head.html') %>

<%- include('../components/toast.html') %>

<body style="display: flex; justify-items: center; align-items: center; min-height: 100vh; padding: 20px;">
Expand Down

0 comments on commit c44706f

Please sign in to comment.