types: move User type closer to service

This commit is contained in:
Chika 2022-04-24 14:13:50 +03:00
parent f8c2701183
commit e1e944da30
4 changed files with 11 additions and 11 deletions

View File

@ -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;

View File

@ -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
View File

@ -0,0 +1,8 @@
export type User = {
displayName: string;
username: string;
department: string;
position: string;
mail: string;
domain: string;
};

View File

@ -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;