feat: minor bug fixes and text changes

This commit is contained in:
Akhil Mohan
2024-03-12 21:49:33 +05:30
parent f1f18e81cd
commit 4152b3a524
11 changed files with 51 additions and 40 deletions
@@ -1,3 +1,4 @@
import ms from "ms";
import { z } from "zod";
import {
@@ -69,13 +70,12 @@ export const registerIdentityProjectRouter = async (server: FastifyZodProvider)
role: z.string(),
isTemporary: z.literal(true),
temporaryMode: z.nativeEnum(ProjectUserMembershipTemporaryMode),
temporaryRange: z.string(),
temporaryRange: z.string().refine((val) => ms(val) > 0, "Temporary range must be positive"),
temporaryAccessStartTime: z.string().datetime()
})
])
)
.min(1)
.refine((data) => data.some(({ isTemporary }) => !isTemporary), "Atleast one permanent role required")
}),
response: {
200: z.object({