chore: add prettier with config and format all files
This commit is contained in:
@@ -11,12 +11,22 @@ export const POST = withAuth(async (req: NextRequest) => {
|
||||
const body = await req.json();
|
||||
const {
|
||||
title,
|
||||
pos_x = 0, pos_y = 0, width = 2, height = 4,
|
||||
signal_type = 'both', chart_type = 'signals', viz_type = 'line',
|
||||
filter_combinators = null, filter_items = null,
|
||||
filter_items_exclude = null, filter_items_regex = false,
|
||||
y_min = null, y_max = null, y_scale = 'linear',
|
||||
series_limit = 20, order_by = 'value_asc',
|
||||
pos_x = 0,
|
||||
pos_y = 0,
|
||||
width = 2,
|
||||
height = 4,
|
||||
signal_type = 'both',
|
||||
chart_type = 'signals',
|
||||
viz_type = 'line',
|
||||
filter_combinators = null,
|
||||
filter_items = null,
|
||||
filter_items_exclude = null,
|
||||
filter_items_regex = false,
|
||||
y_min = null,
|
||||
y_max = null,
|
||||
y_scale = 'linear',
|
||||
series_limit = 20,
|
||||
order_by = 'value_asc',
|
||||
} = body;
|
||||
|
||||
if (!title) return NextResponse.json({ error: 'title required' }, { status: 400 });
|
||||
@@ -28,9 +38,25 @@ export const POST = withAuth(async (req: NextRequest) => {
|
||||
y_min,y_max,y_scale,series_limit,order_by)
|
||||
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17)
|
||||
RETURNING *`,
|
||||
[title,pos_x,pos_y,width,height,signal_type,chart_type,viz_type,
|
||||
filter_combinators,filter_items,filter_items_exclude,filter_items_regex,
|
||||
y_min,y_max,y_scale,series_limit,order_by],
|
||||
[
|
||||
title,
|
||||
pos_x,
|
||||
pos_y,
|
||||
width,
|
||||
height,
|
||||
signal_type,
|
||||
chart_type,
|
||||
viz_type,
|
||||
filter_combinators,
|
||||
filter_items,
|
||||
filter_items_exclude,
|
||||
filter_items_regex,
|
||||
y_min,
|
||||
y_max,
|
||||
y_scale,
|
||||
series_limit,
|
||||
order_by,
|
||||
],
|
||||
);
|
||||
return NextResponse.json(result.rows[0], { status: 201 });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user