Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ test("return the role", async (t) => {
expect(res.status, `expected 200, received: ${JSON.stringify(res, null, 2)}`).toBe(200);
expect(res.body.id).toEqual(permission.id);
expect(res.body.name).toEqual(permission.name);
expect(res.body.slug).toEqual(permission.slug);
expect(res.body.description).toBeUndefined();
});
5 changes: 5 additions & 0 deletions apps/api/src/routes/v1_permissions_getPermission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ const route = createRoute({
description: "The name of the permission.",
example: "domain.record.manager",
}),
slug: z.string().openapi({
description: "The slug of the permission",
example: "domain-record-manager",
}),
description: z.string().optional().openapi({
description:
"The description of what this permission does. This is just for your team, your users will not see this.",
Expand Down Expand Up @@ -75,6 +79,7 @@ export const registerV1PermissionsGetPermission = (app: App) =>
return c.json({
id: permission.id,
name: permission.name,
slug: permission.slug,
description: permission.description ?? undefined,
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ test("return all permissions", async (t) => {
expect(res.body.length).toBe(1);
expect(res.body[0].id).toEqual(permission.id);
expect(res.body[0].name).toEqual(permission.name);
expect(res.body[0].slug).toEqual(permission.slug);
expect(res.body[0].description).toBeUndefined();
});
5 changes: 5 additions & 0 deletions apps/api/src/routes/v1_permissions_listPermissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ const route = createRoute({
description: "The name of the permission.",
example: "domain.record.manager",
}),
slug: z.string().openapi({
description: "The slug of the permission",
example: "domain-record-manager",
}),
description: z.string().optional().openapi({
description:
"The description of what this permission does. This is just for your team, your users will not see this.",
Expand Down Expand Up @@ -62,6 +66,7 @@ export const registerV1PermissionsListPermissions = (app: App) =>
permissions.map((p) => ({
id: p.id,
name: p.name,
slug: p.slug,
description: p.description ?? undefined,
})),
);
Expand Down
Loading