style: format code
This commit is contained in:
parent
637f33d0ff
commit
3e877ea1d2
7 changed files with 33 additions and 13 deletions
|
@ -76,4 +76,4 @@
|
|||
},
|
||||
"security": []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { getApiDocs } from "@/lib/swagger";
|
||||
import ReactSwagger from "./react-swagger";
|
||||
import { getApiDocs } from '@/lib/swagger';
|
||||
import ReactSwagger from './react-swagger';
|
||||
|
||||
export default async function IndexPage() {
|
||||
const spec = await getApiDocs();
|
||||
return (
|
||||
<section className="container">
|
||||
<section className='container'>
|
||||
<ReactSwagger spec={spec} />
|
||||
</section>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,11 @@ import SwaggerUI from 'swagger-ui-react';
|
|||
import 'swagger-ui-react/swagger-ui.css';
|
||||
|
||||
type Props = {
|
||||
spec: object,
|
||||
spec: object;
|
||||
};
|
||||
|
||||
function ReactSwagger({ spec }: Props) {
|
||||
return <SwaggerUI spec={spec} />;
|
||||
}
|
||||
|
||||
export default ReactSwagger;
|
||||
export default ReactSwagger;
|
||||
|
|
|
@ -357,7 +357,14 @@ export const PATCH = auth(async (req, { params }) => {
|
|||
|
||||
const { title, description, start_time, end_time, location, status } = body;
|
||||
|
||||
if (!title && !description && !start_time && !end_time && !location && !status) {
|
||||
if (
|
||||
!title &&
|
||||
!description &&
|
||||
!start_time &&
|
||||
!end_time &&
|
||||
!location &&
|
||||
!status
|
||||
) {
|
||||
return NextResponse.json(
|
||||
{ success: false, message: 'No fields to update' },
|
||||
{ status: 400 },
|
||||
|
@ -406,5 +413,8 @@ export const PATCH = auth(async (req, { params }) => {
|
|||
data: updateData,
|
||||
});
|
||||
|
||||
return NextResponse.json({ success: true, event: updatedEvent }, { status: 200 });
|
||||
return NextResponse.json(
|
||||
{ success: true, event: updatedEvent },
|
||||
{ status: 200 },
|
||||
);
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
"use client";
|
||||
'use client';
|
||||
|
||||
import { RedirectButton } from '@/components/buttons/redirect-button';
|
||||
import { ThemePicker } from '@/components/misc/theme-picker';
|
||||
|
@ -11,7 +11,10 @@ export default function Home() {
|
|||
<div className='flex flex-col items-center justify-center h-screen'>
|
||||
<div className='absolute top-4 right-4'>{<ThemePicker />}</div>
|
||||
<div>
|
||||
<h1>Hello {isLoading ? 'Loading...' : data?.data.user?.name || 'Unknown User'}</h1>
|
||||
<h1>
|
||||
Hello{' '}
|
||||
{isLoading ? 'Loading...' : data?.data.user?.name || 'Unknown User'}
|
||||
</h1>
|
||||
<RedirectButton redirectUrl='/logout' buttonText='Logout' />
|
||||
<RedirectButton redirectUrl='/settings' buttonText='Settings' />
|
||||
</div>
|
||||
|
|
|
@ -25,7 +25,11 @@ const providers: Provider[] = [
|
|||
Credentials({
|
||||
credentials: { password: { label: 'Password', type: 'password' } },
|
||||
async authorize(c) {
|
||||
if (process.env.NODE_ENV === 'development' && process.env.DISABLE_AUTH_TEST_USER !== 'true' && c.password === 'password')
|
||||
if (
|
||||
process.env.NODE_ENV === 'development' &&
|
||||
process.env.DISABLE_AUTH_TEST_USER !== 'true' &&
|
||||
c.password === 'password'
|
||||
)
|
||||
return {
|
||||
id: 'test',
|
||||
name: 'Test User',
|
||||
|
|
|
@ -35,7 +35,10 @@ export async function registerAction(data: z.infer<typeof registerSchema>) {
|
|||
},
|
||||
});
|
||||
|
||||
if (existingUsername || disallowedUsernames.includes(username.toLowerCase())) {
|
||||
if (
|
||||
existingUsername ||
|
||||
disallowedUsernames.includes(username.toLowerCase())
|
||||
) {
|
||||
return {
|
||||
error: 'Username already exists',
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue