Skip to content

Commit 3ad390f

Browse files
committed
sort returned policies
1 parent 6a21ebc commit 3ad390f

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

apps/web/app/routes/ws/policies.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,15 @@ export default function Policies() {
245245
</TableRow>
246246
</TableHeader>
247247
<TableBody>
248-
{policies.map((policy) => (
249-
<PolicyRow
250-
key={policy.id}
251-
policy={policy}
252-
onDelete={() => setPolicyToDelete(policy)}
253-
/>
254-
))}
248+
{policies
249+
.sort((a, b) => a.name.localeCompare(b.name))
250+
.map((policy) => (
251+
<PolicyRow
252+
key={policy.id}
253+
policy={policy}
254+
onDelete={() => setPolicyToDelete(policy)}
255+
/>
256+
))}
255257
</TableBody>
256258
</Table>
257259
</>

packages/trpc/src/routes/policies.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ export const policiesRouter = router({
4141
"/v1/workspaces/{workspaceId}/policies/{policyId}",
4242
{
4343
params: {
44-
path: {
45-
workspaceId,
46-
policyId,
47-
},
44+
path: { workspaceId, policyId },
4845
},
4946
},
5047
);

0 commit comments

Comments
 (0)