Skip to content

Commit

Permalink
fix(build): remove cross import from client to server for UserType
Browse files Browse the repository at this point in the history
  • Loading branch information
sct committed Jan 14, 2021
1 parent 492e19d commit 23624bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 4 additions & 0 deletions server/constants/user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export enum UserType {
PLEX = 1,
LOCAL = 2,
}
2 changes: 1 addition & 1 deletion server/routes/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { isAuthenticated } from '../middleware/auth';
import { Permission } from '../lib/permissions';
import logger from '../logger';
import { getSettings } from '../lib/settings';
import { UserType } from '../../src/hooks/useUser';
import { UserType } from '../constants/user';

const authRoutes = Router();

Expand Down
8 changes: 2 additions & 6 deletions src/hooks/useUser.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import useSwr from 'swr';
import { hasPermission, Permission } from '../../server/lib/permissions';

export enum UserType {
PLEX = 1,
LOCAL = 2,
}
import { UserType } from '../../server/constants/user';

export interface User {
id: number;
Expand All @@ -15,7 +11,7 @@ export interface User {
userType: number;
}

export { Permission };
export { Permission, UserType };

interface UserHookResponse {
user?: User;
Expand Down

0 comments on commit 23624bd

Please sign in to comment.