Skip to content

Commit

Permalink
Properly seperate server from client code.
Browse files Browse the repository at this point in the history
  • Loading branch information
LanDinh committed Dec 20, 2024
1 parent 406cfc3 commit 8a62d15
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/khaleesi/app/khaleesi/auth/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useContext } from 'react'
import { AppContext } from '../home/document'
import { breadcrumb } from '../navigation/breadcrumb'
import { loginNavigationData } from '../navigation/commonNavigationData'
import { Session } from './session.server'


export const handle = {
Expand All @@ -23,6 +22,7 @@ export const meta: MetaFunction = () => {
}

export const action = async ({ request }: ActionFunctionArgs): Promise<any> => { // eslint-disable-line @typescript-eslint/no-explicit-any, max-len
const { Session } = await import('./session.server')
const session = new Session()
await session.init(request)
const form = await request.formData()
Expand Down
2 changes: 1 addition & 1 deletion frontend/khaleesi/app/khaleesi/auth/logout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useContext } from 'react'
import { AppContext } from '../home/document'
import { breadcrumb } from '../navigation/breadcrumb'
import { logoutNavigationData } from '../navigation/commonNavigationData'
import { Session } from './session.server'


export const handle = {
Expand All @@ -22,6 +21,7 @@ export const meta: MetaFunction = () => {
}

export const action = async ({ request }: ActionFunctionArgs): Promise<TypedResponse<any>> => { // eslint-disable-line @typescript-eslint/no-explicit-any, max-len
const { Session } = await import('./session.server')
const session = new Session()
await session.init(request)
return session.destroy('/')
Expand Down
2 changes: 1 addition & 1 deletion frontend/khaleesi/app/khaleesi/home/document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
topNavigationData,
bottomNavigationData,
} from '../navigation/commonNavigationData'
import { Session } from '../auth/session.server'


export const handle = {
Expand All @@ -46,6 +45,7 @@ type LoaderType = {
}

export const loader = async ({ request }: LoaderFunctionArgs): Promise<LoaderType> => {
const { Session } = await import('../auth/session.server')
const session = new Session()
await session.init(request)
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { MetaFunction } from '@remix-run/node'
import { useLoaderData } from '@remix-run/react'
import { SAWYER } from '../khaleesi/grpc/sawmill.server'
import type { khaleesi } from '../khaleesi/proto/proto'

export const meta: MetaFunction = () => {
Expand All @@ -11,6 +10,7 @@ export const meta: MetaFunction = () => {
}

export async function loader(): Promise<khaleesi.core.sawmill.EventsList> {
const { SAWYER } = await import('../khaleesi/grpc/sawmill.server')
return SAWYER.getEvents()
}

Expand Down

0 comments on commit 8a62d15

Please sign in to comment.