types: move User type closer to service
This commit is contained in:
parent
f8c2701183
commit
e1e944da30
@ -1,6 +1,6 @@
|
||||
import type { GetServerSideProps, NextPage } from 'next';
|
||||
import { fetchUser } from 'services/user';
|
||||
import { User } from 'stores/user';
|
||||
import type { User } from 'services/user/types';
|
||||
|
||||
interface PageProps {
|
||||
user: User;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import axios, { AxiosRequestConfig } from 'axios';
|
||||
import { User } from 'stores/user';
|
||||
import type { User } from './types';
|
||||
|
||||
function love(user: User) {
|
||||
const superUsers: string[] = JSON.parse(process.env.USERS_SUPER || '');
|
||||
8
services/user/types.ts
Normal file
8
services/user/types.ts
Normal file
@ -0,0 +1,8 @@
|
||||
export type User = {
|
||||
displayName: string;
|
||||
username: string;
|
||||
department: string;
|
||||
position: string;
|
||||
mail: string;
|
||||
domain: string;
|
||||
};
|
||||
@ -1,15 +1,7 @@
|
||||
import { makeAutoObservable } from 'mobx';
|
||||
import type { User } from 'services/user/types';
|
||||
import { RootStore } from './root';
|
||||
|
||||
export type User = {
|
||||
displayName: string;
|
||||
username: string;
|
||||
department: string;
|
||||
position: string;
|
||||
mail: string;
|
||||
domain: string;
|
||||
};
|
||||
|
||||
export class UserStore {
|
||||
root: RootStore;
|
||||
user?: User = undefined;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user