chore: add prettier with config and format all files
This commit is contained in:
@@ -10,15 +10,16 @@ export const GET = withAuth(async () => {
|
||||
export const POST = withAuth(async (req: NextRequest) => {
|
||||
const body = await req.json();
|
||||
const {
|
||||
item_key, item_key_is_regex = false,
|
||||
combinator = null, signal_type = 'green', condition, threshold,
|
||||
item_key,
|
||||
item_key_is_regex = false,
|
||||
combinator = null,
|
||||
signal_type = 'green',
|
||||
condition,
|
||||
threshold,
|
||||
} = body;
|
||||
|
||||
if (!item_key || !condition || threshold === undefined) {
|
||||
return NextResponse.json(
|
||||
{ error: 'item_key, condition, threshold required' },
|
||||
{ status: 400 },
|
||||
);
|
||||
return NextResponse.json({ error: 'item_key, condition, threshold required' }, { status: 400 });
|
||||
}
|
||||
|
||||
const result = await pool.query(
|
||||
@@ -27,4 +28,4 @@ export const POST = withAuth(async (req: NextRequest) => {
|
||||
[item_key, item_key_is_regex, combinator, signal_type, condition, threshold],
|
||||
);
|
||||
return NextResponse.json(result.rows[0], { status: 201 });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user