From 282b34c66bad80ca0b7e00e2f8411d0c140df7cd Mon Sep 17 00:00:00 2001 From: Wellington Braga Date: Thu, 5 Dec 2024 02:39:20 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20:bug:=20Corrige=20a=20troca=20repentina?= =?UTF-8?q?=20do=20conte=C3=BAdo=20de=20noMobileDevice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/noMobileDevice/page.tsx | 15 ++++++- src/database/index.ts | 30 ++++++++------ src/screens/NoMobileDevice/index.tsx | 61 +++++++++++++--------------- src/server/controllers/Session.ts | 3 +- 4 files changed, 62 insertions(+), 47 deletions(-) diff --git a/src/app/noMobileDevice/page.tsx b/src/app/noMobileDevice/page.tsx index f383f23..36f3635 100644 --- a/src/app/noMobileDevice/page.tsx +++ b/src/app/noMobileDevice/page.tsx @@ -1,3 +1,16 @@ import { NoMobileDevicePage } from "@/screens"; +import { getTextTheme } from "@/screens/NoMobileDevice/themeTitle"; -export default NoMobileDevicePage; +const NoMobileDevice = () => { + const theme = getTextTheme(); + const { text, title } = theme; + + return ( + + ); +}; + +export default NoMobileDevice; diff --git a/src/database/index.ts b/src/database/index.ts index 9056f8e..5031be8 100644 --- a/src/database/index.ts +++ b/src/database/index.ts @@ -15,8 +15,6 @@ import { } from "../server/entities"; import { options } from "./config/config"; -// [`${path.resolve(__dirname, "../")}server/entities/*.ts`], - const sqliteDataSource = new DataSource({ type: "sqlite", database: options.storage, @@ -42,17 +40,7 @@ const mySqlDataSource = new DataSource({ username: options.username, password: options.password, database: options.database, - entities: [ - Event, - Ticket, - User, - Session, - Address, - ColorScheme, - Enterprise, - IssueCategory, - Subsidiary, - ], + entities: [Event, Ticket, User, Session], // synchronize: process.env.NODE_ENV !== "production", synchronize: false, ...(process.env.DB_CA && { @@ -84,6 +72,14 @@ const startDBConnection = async () => { category: "database", level: "log", message: "Data Source has been initialized!", + data: { + database: options.database, + dialect: options.dialect, + host: options.host, + port: options.port, + userName: options.username, + storage: options.storage, + }, }); console.log("Data Source has been initialized!"); } @@ -93,6 +89,14 @@ const startDBConnection = async () => { category: "database", level: "error", message: "Error during Data Source initialization", + data: { + database: options.database, + dialect: options.dialect, + host: options.host, + port: options.port, + userName: options.username, + storage: options.storage, + }, }); captureException(err, { tags: { diff --git a/src/screens/NoMobileDevice/index.tsx b/src/screens/NoMobileDevice/index.tsx index cff67d2..d54eea8 100644 --- a/src/screens/NoMobileDevice/index.tsx +++ b/src/screens/NoMobileDevice/index.tsx @@ -3,7 +3,6 @@ import Logo from "public/Icon.png"; import qrCode from "public/qr-code.png"; -import { useMemo } from "react"; import { NoMobileContainer, NoMobileContent, @@ -14,40 +13,38 @@ import { QRCodeImage, QRCodeText, } from "./styles"; -import { getTextTheme } from "./themeTitle"; -const NoMobileDevicePage = () => { - const theme = useMemo(() => getTextTheme(), []); +export interface NoMobileDeviceProps { + title: string; + text: string; +} - const { text, title } = theme; - - return ( - - ( + + + + {title} + {text} + + + + Escaneie o QR Code para acessar o Services pelo seu celular + + - - {title} - {text} - - - - Escaneie o QR Code para acessar o Services pelo seu celular - - - - - ); -}; + + +); export { NoMobileDevicePage }; diff --git a/src/server/controllers/Session.ts b/src/server/controllers/Session.ts index 2c59367..1136dfc 100644 --- a/src/server/controllers/Session.ts +++ b/src/server/controllers/Session.ts @@ -173,7 +173,7 @@ export class SessionController { return NextResponse.json( UserView.getUser({ - error: { message: AuthErrorMessage.InvalidLoginError }, + error, status: 500, }), { @@ -247,6 +247,7 @@ export class SessionController { return NextResponse.redirect(new URL("/login", req.nextUrl.clone())); } catch (error) { + console.log({ error }); const err = error as Error; captureException(error, {