Skip to content

Commit

Permalink
replace orderBy with toSorted
Browse files Browse the repository at this point in the history
  • Loading branch information
vorant94 committed Apr 22, 2024
1 parent db861b0 commit cf264ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ primary_region = 'waw'
[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1
auto_stop_machines = false
auto_start_machines = false
processes = ['app']

[[vm]]
Expand Down
9 changes: 4 additions & 5 deletions packages/blog/src/projects/handlers/projects.handler.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { FastifyPluginAsync } from 'fastify';
import { groupBy, orderBy } from 'lodash-es';
import { groupBy } from 'lodash-es';
import { contentType, statusCode } from '../../http/index.js';
import { DefaultLayout, render } from '../../ui/index.js';
import { ProjectTiledList } from '../components/ProjectTiledList.js';
Expand Down Expand Up @@ -27,10 +27,9 @@ export const projectsHandler: FastifyPluginAsync = async function (app) {
(project) => project.matter.status,
);

const statuses = orderBy(
Object.keys(projectsByStatus) as ProjectStatus[],
(status) => projectStatusOrder[status],
);
const statuses = (
Object.keys(projectsByStatus) as ProjectStatus[]
).toSorted((a, b) => projectStatusOrder[a] - projectStatusOrder[b]);

const changelogsByProject = groupBy(allChangelogs, (changelog) =>
getProjectIdFromChangelogPath(changelog.path),
Expand Down

0 comments on commit cf264ca

Please sign in to comment.