Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

routes直下をディレクトリで分割した #111

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/app/components/header/HeaderLoginButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const HeaderLoginButton = () => {
<Button
variant="default"
leftSection={<LuLogIn />}
onClick={() => navigate('/auth/login')}
onClick={() => navigate('/login')}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これで開けるんだなぁ

>
ログイン
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { redirect, type MetaFunction } from '@remix-run/cloudflare';

export const meta: MetaFunction = () => {
return [
{ title: 'New Remix App' },
{ name: 'description', content: 'Welcome to Remix!' },
{ title: 'KITCC Library' },
{
name: 'KITCCが所有する書籍を管理するWebアプリ',
content: 'Welcome to KITCC Library!',
},
];
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {
// 未ログインの場合
if (!session.has('userId')) {
session.flash('error', 'ログインしてください');
return redirect('/auth/login', {
return redirect('/login', {
headers: {
'Set-Cookie': await commitSession(session),
},
Expand Down Expand Up @@ -88,7 +88,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {
});
case 401:
session.flash('error', 'ログインしてください');
return redirect('/auth/login', {
return redirect('/login', {
headers: {
'Set-Cookie': await commitSession(session),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
// 未ログインの場合
if (!session.has('userId')) {
// ログインページへリダイレクト
return redirect('/auth/login');
return redirect('/login');
}

return null;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {
session.flash('error', 'エラーが発生しました');
}

return redirect('/auth/login', {
return redirect('/login', {
headers: {
'Set-Cookie': await commitSession(session),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type * as remixruncloudflare from '@remix-run/cloudflare';
import { ActionFunctionArgs, LoaderFunctionArgs } from '@remix-run/cloudflare';
import { createRemixStub } from '@remix-run/testing';
import { screen } from '@testing-library/react';
import LoginPage, { action, loader } from '~/routes/auth.login';
import LoginPage, { action, loader } from '~/routes/login/route';
import { customRender } from '../helpers/wrapper';
import { redirect } from '../mocks/@remix-run/cloudflare';

Expand Down
Loading