Skip to content

Commit

Permalink
style: run prettier on code
Browse files Browse the repository at this point in the history
  • Loading branch information
jpedroh committed Sep 17, 2023
1 parent da66e39 commit f7d28e6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion packages/app/app/api/flights/all/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ export async function GET(request: Request) {
orderBy: (fields, { desc }) => desc(fields.id),
where: (fields, { sql, and, eq }) =>
and(
data.data.cycle ? sql`${fields.cycle} IN ${data.data.cycle}` : eq(fields.cycle, currentCycleSubquery),
data.data.cycle
? sql`${fields.cycle} IN ${data.data.cycle}`
: eq(fields.cycle, currentCycleSubquery),
data.data.departureIcao &&
sql`${fields.departureIcao} IN ${data.data.departureIcao}`,
data.data.arrivalIcao &&
Expand Down
4 changes: 3 additions & 1 deletion packages/app/app/api/flights/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ export async function GET(request: Request) {
}

const criteria = and(
data.data.cycle ? sql`${flights.cycle} IN ${data.data.cycle}` : eq(flights.cycle, currentCycleSubquery),
data.data.cycle
? sql`${flights.cycle} IN ${data.data.cycle}`
: eq(flights.cycle, currentCycleSubquery),
data.data.departureIcao &&
sql`${flights.departureIcao} IN ${data.data.departureIcao}`,
data.data.arrivalIcao &&
Expand Down
4 changes: 1 addition & 3 deletions packages/app/src/components/SearchFlightsForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ const SearchFlightsForm: FC<Props> = ({
options={cyclesOptions}
name="cycle"
defaultValue={cyclesOptions[0]}
onChange={(cycle) =>
setForm((form) => ({ ...form, cycle }))
}
onChange={(cycle) => setForm((form) => ({ ...form, cycle }))}
/>
</div>

Expand Down
4 changes: 3 additions & 1 deletion packages/app/src/services/fetch-flights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export async function fetchFlights(searchParams: Record<string, unknown>) {
const flights = await db.query.flights.findMany({
where: (fields, { sql, and, eq, or }) =>
and(
where.cycle ? eq(fields.cycle, where.cycle) : eq(fields.cycle, currentCycleSubquery),
where.cycle
? eq(fields.cycle, where.cycle)
: eq(fields.cycle, currentCycleSubquery),
where.departureIcao
? eq(fields.departureIcao, where.departureIcao)
: undefined,
Expand Down

0 comments on commit f7d28e6

Please sign in to comment.