Skip to content

Commit a4d879f

Browse files
committed
fix response types
1 parent 17ad20c commit a4d879f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/api/routes/iam.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
groupModificationPatchSchema,
3333
GroupModificationPatchRequest,
3434
EntraGroupActions,
35+
entraGroupMembershipListResponse,
3536
} from "../../common/types/iam.js";
3637

3738
const dynamoClient = new DynamoDBClient({
@@ -143,7 +144,7 @@ const iamRoutes: FastifyPluginAsync = async (fastify, _options) => {
143144
"/inviteUsers",
144145
{
145146
schema: {
146-
response: { 200: zodToJsonSchema(entraActionResponseSchema) },
147+
response: { 202: zodToJsonSchema(entraActionResponseSchema) },
147148
},
148149
preValidation: async (request, reply) => {
149150
await fastify.zodValidateBody(request, reply, invitePostRequestSchema);
@@ -289,6 +290,7 @@ const iamRoutes: FastifyPluginAsync = async (fastify, _options) => {
289290
"/groups/:groupId",
290291
{
291292
schema: {
293+
response: { 200: zodToJsonSchema(entraGroupMembershipListResponse) },
292294
querystring: {
293295
type: "object",
294296
properties: {

src/common/types/iam.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,14 @@ export const groupModificationPatchSchema = z.object({
5151
export type GroupModificationPatchRequest = z.infer<
5252
typeof groupModificationPatchSchema
5353
>;
54+
55+
export const entraGroupMembershipListResponse = z.array(
56+
z.object({
57+
name: z.string(),
58+
email: z.string(),
59+
}),
60+
);
61+
62+
export type GroupMemberGetResponse = z.infer<
63+
typeof entraGroupMembershipListResponse
64+
>;

0 commit comments

Comments
 (0)