Skip to content

Commit

Permalink
style: apply pretty
Browse files Browse the repository at this point in the history
  • Loading branch information
rito528 committed Mar 22, 2024
1 parent b3cf67e commit 3c8ca53
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/app/(authed)/admin/forms/edit/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client';

import { redirect } from 'next/navigation';
import useSWR from 'swr';
import DashboardMenu from '@/components/DashboardMenu';
import { EditFormComponent } from '@/features/form/components/editForm';
import { Form } from '@/features/form/types/formSchema';
import useSWR from 'swr';
import type { Form } from '@/features/form/types/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/(unauthed)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const Home = () => {
.catch((e) => console.log(e));
}
})().catch((e) => console.log(e));
}, [inProgress, accounts, isInitialized, instance, router]);
}, [inProgress, accounts, isInitialized, instance, router, callbackUrl]);

return <></>;
};
Expand Down
4 changes: 1 addition & 3 deletions src/app/api/answers/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ export async function POST(req: NextRequest) {
return NextResponse.redirect('/');
}

const body = await req.json();

const response = await fetch(`${BACKEND_SERVER_URL}/forms/answers`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`,
},
body: JSON.stringify(body),
body: JSON.stringify(await req.json()),
cache: 'no-cache',
});

Expand Down
3 changes: 2 additions & 1 deletion src/app/api/util/responseOrErrorResponse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NextRequest, NextResponse } from 'next/server';
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';

export function redirectByResponse(reqest: NextRequest, response: Response) {
if (response.ok) {
Expand Down
4 changes: 2 additions & 2 deletions src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use server';

import { getCachedToken } from './features/user/api/mcToken';
import { NextResponse, type NextRequest } from 'next/server';
import { User } from './features/user/types/userSchema';
import { BACKEND_SERVER_URL } from './env';
import { getCachedToken } from './features/user/api/mcToken';
import type { User } from './features/user/types/userSchema';

export const middleware = async (request: NextRequest) => {
if (request.method !== 'GET') {
Expand Down

0 comments on commit 3c8ca53

Please sign in to comment.