Skip to content

Commit

Permalink
refactor: schemaを_schemasディレクトリに移動
Browse files Browse the repository at this point in the history
  • Loading branch information
rito528 committed Apr 11, 2024
1 parent a279bb7 commit 1472d48
Show file tree
Hide file tree
Showing 16 changed files with 13 additions and 18 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
});
File renamed without changes.
2 changes: 1 addition & 1 deletion src/app/(authed)/admin/forms/edit/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/app/(authed)/admin/forms/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/app/(authed)/admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/app/(authed)/forms/[formId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/app/(authed)/forms/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/minecraft-access-token/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -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 },
Expand Down
2 changes: 1 addition & 1 deletion src/features/form/components/AnswerForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/features/form/components/CreateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/features/form/components/DashboardFormList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/features/form/components/FormList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/features/form/components/editForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit 1472d48

Please sign in to comment.