diff --git a/src/features/form/types/formSchema.ts b/src/_schemas/formSchema.ts similarity index 100% rename from src/features/form/types/formSchema.ts rename to src/_schemas/formSchema.ts diff --git a/src/features/user/types/loginSchema.ts b/src/_schemas/loginSchema.ts similarity index 76% rename from src/features/user/types/loginSchema.ts rename to src/_schemas/loginSchema.ts index 6318e2eb..5caf9566 100644 --- a/src/features/user/types/loginSchema.ts +++ b/src/_schemas/loginSchema.ts @@ -11,8 +11,3 @@ export const minecraftAccessTokenResponseSchema = z.object({ access_token: z.string(), expires_in: z.number().int(), }); - -export const minecraftProfileResponseSchema = z.object({ - id: z.string(), - name: z.string(), -}); diff --git a/src/features/user/types/userSchema.ts b/src/_schemas/userSchema.ts similarity index 100% rename from src/features/user/types/userSchema.ts rename to src/_schemas/userSchema.ts diff --git a/src/app/(authed)/admin/forms/edit/[id]/page.tsx b/src/app/(authed)/admin/forms/edit/[id]/page.tsx index 24a6da3b..7396ebb3 100644 --- a/src/app/(authed)/admin/forms/edit/[id]/page.tsx +++ b/src/app/(authed)/admin/forms/edit/[id]/page.tsx @@ -4,7 +4,7 @@ import { redirect } from 'next/navigation'; import useSWR from 'swr'; import DashboardMenu from '@/components/DashboardMenu'; import { EditFormComponent } from '@/features/form/components/editForm'; -import type { Form } from '@/features/form/types/formSchema'; +import type { Form } from '@/_schemas/formSchema'; const Home = ({ params }: { params: { id: number } }) => { const fetcher = (url: string) => fetch(url).then((res) => res.json()); diff --git a/src/app/(authed)/admin/forms/page.tsx b/src/app/(authed)/admin/forms/page.tsx index b9c09185..8ce8e06d 100644 --- a/src/app/(authed)/admin/forms/page.tsx +++ b/src/app/(authed)/admin/forms/page.tsx @@ -7,7 +7,7 @@ import { CreateFormButton, Forms, } from '@/features/form/components/DashboardFormList'; -import type { MinimumForm } from '@/features/form/types/formSchema'; +import type { MinimumForm } from '@/_schemas/formSchema'; const Home = () => { const fetcher = (url: string) => fetch(url).then((res) => res.json()); diff --git a/src/app/(authed)/admin/page.tsx b/src/app/(authed)/admin/page.tsx index 34147391..32dc7d15 100644 --- a/src/app/(authed)/admin/page.tsx +++ b/src/app/(authed)/admin/page.tsx @@ -4,7 +4,7 @@ import { redirect } from 'next/navigation'; import useSWR from 'swr'; import DataTable from '@/components/Dashboard'; import DashboardMenu from '@/components/DashboardMenu'; -import type { BatchAnswer } from '@/features/form/types/formSchema'; +import type { BatchAnswer } from '@/_schemas/formSchema'; const Home = () => { const fetcher = (url: string) => fetch(url).then((res) => res.json()); diff --git a/src/app/(authed)/forms/[formId]/page.tsx b/src/app/(authed)/forms/[formId]/page.tsx index e6316857..913127ea 100644 --- a/src/app/(authed)/forms/[formId]/page.tsx +++ b/src/app/(authed)/forms/[formId]/page.tsx @@ -3,7 +3,7 @@ import { redirect } from 'next/navigation'; import useSWR from 'swr'; import AnswerForm from '@/features/form/components/AnswerForm'; -import type { FormQuestion } from '@/features/form/types/formSchema'; +import type { FormQuestion } from '@/_schemas/formSchema'; const Home = ({ params }: { params: { formId: number } }) => { const fetcher = (url: string) => fetch(url).then((res) => res.json()); diff --git a/src/app/(authed)/forms/page.tsx b/src/app/(authed)/forms/page.tsx index 33bc3d7d..9ad87d0a 100644 --- a/src/app/(authed)/forms/page.tsx +++ b/src/app/(authed)/forms/page.tsx @@ -3,7 +3,7 @@ import { redirect } from 'next/navigation'; import useSWR from 'swr'; import FormList from '@/features/form/components/FormList'; -import type { MinimumForm } from '@/features/form/types/formSchema'; +import type { MinimumForm } from '@/_schemas/formSchema'; const Home = () => { const fetcher = (url: string) => fetch(url).then((res) => res.json()); diff --git a/src/app/api/minecraft-access-token/route.ts b/src/app/api/minecraft-access-token/route.ts index 1329152e..c60f1d40 100644 --- a/src/app/api/minecraft-access-token/route.ts +++ b/src/app/api/minecraft-access-token/route.ts @@ -4,7 +4,7 @@ import { NextResponse } from 'next/server'; import { minecraftAccessTokenResponseSchema, xboxLiveServiceTokenResponseSchema, -} from '@/features/user/types/loginSchema'; +} from '@/_schemas/loginSchema'; import type { NextRequest } from 'next/server'; export async function POST(req: NextRequest) { diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx index 0bd1472d..57be1753 100644 --- a/src/components/Dashboard.tsx +++ b/src/components/Dashboard.tsx @@ -1,7 +1,7 @@ 'use client'; import { DataGrid, type GridColDef } from '@mui/x-data-grid'; import * as React from 'react'; -import type { BatchAnswer } from '@/features/form/types/formSchema'; +import type { BatchAnswer } from '@/_schemas/formSchema'; const columns: GridColDef[] = [ { field: 'category', headerName: '種別', width: 200 }, diff --git a/src/features/form/components/AnswerForm.tsx b/src/features/form/components/AnswerForm.tsx index 3e66a126..a92b38fd 100644 --- a/src/features/form/components/AnswerForm.tsx +++ b/src/features/form/components/AnswerForm.tsx @@ -23,7 +23,7 @@ import { } from '@mui/material'; import { useState } from 'react'; import { useForm } from 'react-hook-form'; -import type { FormQuestion } from '../types/formSchema'; +import type { FormQuestion } from '../../../_schemas/formSchema'; import type { NonEmptyArray } from '@/generic/Types'; interface Props { diff --git a/src/features/form/components/CreateForm.tsx b/src/features/form/components/CreateForm.tsx index f1272bb0..1ca92c90 100644 --- a/src/features/form/components/CreateForm.tsx +++ b/src/features/form/components/CreateForm.tsx @@ -19,7 +19,7 @@ import { styled } from '@mui/material/styles'; import TextField from '@mui/material/TextField'; import * as React from 'react'; import { useFieldArray, useForm, useWatch } from 'react-hook-form'; -import type { Visibility } from '../types/formSchema'; +import type { Visibility } from '../../../_schemas/formSchema'; import type { Control, UseFieldArrayAppend, diff --git a/src/features/form/components/DashboardFormList.tsx b/src/features/form/components/DashboardFormList.tsx index 8262e255..d4c458a3 100644 --- a/src/features/form/components/DashboardFormList.tsx +++ b/src/features/form/components/DashboardFormList.tsx @@ -12,7 +12,7 @@ import { styled } from '@mui/material/styles'; import Typography from '@mui/material/Typography'; import * as React from 'react'; import { formatString } from '../../../components/DateFormatter'; -import type { MinimumForm } from '@/features/form/types/formSchema'; +import type { MinimumForm } from '@/_schemas/formSchema'; const Item = styled(Paper)(({ theme }) => ({ backgroundColor: theme.palette.mode === 'dark' ? '#1A2027' : '#fff', diff --git a/src/features/form/components/FormList.tsx b/src/features/form/components/FormList.tsx index 2f62ab12..dfa013cd 100644 --- a/src/features/form/components/FormList.tsx +++ b/src/features/form/components/FormList.tsx @@ -13,7 +13,7 @@ import { } from '@mui/material'; import { formatString } from '@/components/DateFormatter'; import { Link } from '@/components/Link'; -import type { MinimumForm } from '../types/formSchema'; +import type { MinimumForm } from '../../../_schemas/formSchema'; const formatResponsePeriod = (startAt: string | null, endAt: string | null) => { if (startAt != null && endAt != null) { diff --git a/src/features/form/components/editForm.tsx b/src/features/form/components/editForm.tsx index eab176b3..26a0d5c9 100644 --- a/src/features/form/components/editForm.tsx +++ b/src/features/form/components/editForm.tsx @@ -4,7 +4,7 @@ import { Box, FormGroup, Select } from '@material-ui/core'; import { Stack, TextField } from '@mui/material'; import { none, some } from 'fp-ts/lib/Option'; import { useForm } from 'react-hook-form'; -import type { Form } from '../types/formSchema'; +import type { Form } from '../../../_schemas/formSchema'; import type { Option } from 'fp-ts/lib/Option'; import type { UseFormRegister } from 'react-hook-form'; diff --git a/src/middleware.ts b/src/middleware.ts index c632ef0b..2d64e5ff 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -3,7 +3,7 @@ import { NextResponse, type NextRequest } from 'next/server'; import { BACKEND_SERVER_URL } from './env'; import { getCachedToken } from './features/user/api/mcToken'; -import type { User } from './features/user/types/userSchema'; +import type { User } from './_schemas/userSchema'; export const middleware = async (request: NextRequest) => { if (request.method !== 'GET') {