Skip to content

Commit

Permalink
fix: svh error
Browse files Browse the repository at this point in the history
  • Loading branch information
kcwww committed Nov 18, 2024
1 parent 111f512 commit a4a0f1f
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 31 deletions.
9 changes: 0 additions & 9 deletions app/(landing)/demo/page.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion app/(protected)/main/_components/UISection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const UISection = React.forwardRef<
>(({ children }, ref) => {
return (
<>
<section ref={ref} className="ui-section">
<section ref={ref} className="ui-section" style={{ minHeight: '100svh' }}>
{children}
<ModalProvider />
</section>
Expand Down
14 changes: 2 additions & 12 deletions app/api/crystal/message/route.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { NextRequest, NextResponse } from 'next/server';
import { revalidatePath } from 'next/cache';

import { auth } from '@/auth';
import { connectToMongoDB } from '@/shared/database/mongodb/config';
import Crystal from '@/shared/database/mongodb/models/crystalModel';

import Message from '@/shared/database/mongodb/models/messageModel';
import { REVALIDATE_PATHS } from '@/shared/constants/routes';

export const dynamic = 'force-dynamic';

export const DELETE = async (req: NextRequest) => {
const session = await auth();
Expand Down Expand Up @@ -54,9 +54,6 @@ export const DELETE = async (req: NextRequest) => {
return NextResponse.json({ error: 'Crystal not found' }, { status: 404 });
}

// 캐시 업데이트
revalidatePath(REVALIDATE_PATHS.MAIN, 'page');
revalidatePath(REVALIDATE_PATHS.VISIT, 'page');
return NextResponse.json({
message: 'Message deleted',
ok: true,
Expand Down Expand Up @@ -141,10 +138,6 @@ export const POST = async (req: NextRequest) => {
);
}

// 캐시 업데이트
revalidatePath(REVALIDATE_PATHS.MAIN, 'page');
revalidatePath(REVALIDATE_PATHS.MAKE, 'page');
revalidatePath(REVALIDATE_PATHS.VISIT, 'page');
return NextResponse.json({
message: 'Message created',
message_id,
Expand Down Expand Up @@ -180,9 +173,6 @@ export const PATCH = async (req: NextRequest) => {
{ new: true }
);

// 캐시 업데이트
revalidatePath(REVALIDATE_PATHS.MAIN, 'page');
revalidatePath(REVALIDATE_PATHS.VISIT, 'page');
return NextResponse.json({
message: 'Message updated',
ok: true,
Expand Down
2 changes: 2 additions & 0 deletions app/api/crystal/messages/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import Crystal from '@/shared/database/mongodb/models/crystalModel';
import { Crystal as CrystalType } from '@/shared/types/crystal';
import Message from '@/shared/database/mongodb/models/messageModel';

export const dynamic = 'force-dynamic';

export const GET = async (req: NextRequest) => {
const crystalId = req.headers.get('X-Crystal-Id');

Expand Down
9 changes: 2 additions & 7 deletions app/api/crystal/route.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { NextRequest, NextResponse } from 'next/server';
import { revalidatePath } from 'next/cache';

import { auth } from '@/auth';
import { connectToMongoDB } from '@/shared/database/mongodb/config';
import Crystal from '@/shared/database/mongodb/models/crystalModel';
import User from '@/shared/database/mongodb/models/userModel';
import { User as UserType } from '@/shared/types/user';
import { REVALIDATE_PATHS } from '@/shared/constants/routes';

export const dynamic = 'force-dynamic';

export const PATCH = async (req: NextRequest) => {
const session = await auth();
Expand All @@ -23,8 +23,6 @@ export const PATCH = async (req: NextRequest) => {
{ new: true }
);

revalidatePath(REVALIDATE_PATHS.MAIN, 'page');
revalidatePath(REVALIDATE_PATHS.VISIT, 'page');
return NextResponse.json({ message: 'Crystal updated', ok: true });
} catch (error) {
console.error('Error updating crystal:', error);
Expand Down Expand Up @@ -85,9 +83,6 @@ export const POST = async (req: NextRequest) => {
{ new: true }
);

revalidatePath(REVALIDATE_PATHS.MAIN, 'page');
revalidatePath(REVALIDATE_PATHS.MAKE, 'page');
revalidatePath(REVALIDATE_PATHS.VISIT, 'page');
return NextResponse.json({
message: 'Crystal created',
crystal_id,
Expand Down
2 changes: 2 additions & 0 deletions app/api/user/messages/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { connectToMongoDB } from '@/shared/database/mongodb/config';

import Message from '@/shared/database/mongodb/models/messageModel';

export const dynamic = 'force-dynamic';

export const GET = async (req: NextRequest) => {
const userId = req.headers.get('X-User-Id');

Expand Down
2 changes: 2 additions & 0 deletions app/api/user/nickname/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ type NicknameReq = {
username: string;
};

export const dynamic = 'force-dynamic';

export const POST = async (req: NextRequest) => {
// 세션 확인
const session = await auth();
Expand Down
3 changes: 2 additions & 1 deletion app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ html::-webkit-scrollbar {
}

.ui-section {
@apply pointer-events-none relative flex min-h-svh w-full flex-col items-center justify-between overflow-hidden px-10 pb-10 pt-10;
@apply pointer-events-none relative flex w-full flex-col items-center justify-between overflow-hidden px-10 pb-10 pt-10;
min-height: 100svh;
z-index: 1;
}

Expand Down
2 changes: 1 addition & 1 deletion shared/components/ui/UISection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Toaster } from 'sonner';
const UISection = ({ children }: { children: React.ReactNode }) => {
return (
<>
<section className="ui-section">
<section className="ui-section" style={{ minHeight: '100svh' }}>
{children}
<ModalProvider />
</section>
Expand Down

0 comments on commit a4a0f1f

Please sign in to comment.