bigbuffet-rw/app/soapbox/schemas/group-relationship.ts

17 lines
522 B
TypeScript
Raw Normal View History

2023-03-10 10:42:49 -08:00
import z from 'zod';
2023-03-28 08:52:41 -07:00
import { GroupRoles } from './group-member';
2023-03-10 10:42:49 -08:00
const groupRelationshipSchema = z.object({
id: z.string(),
member: z.boolean().catch(false),
requested: z.boolean().catch(false),
2023-03-28 08:52:41 -07:00
role: z.nativeEnum(GroupRoles).catch(GroupRoles.USER),
blocked_by: z.boolean().catch(false),
notifying: z.boolean().nullable().catch(null),
pending_requests: z.boolean().catch(false),
2023-03-10 10:42:49 -08:00
});
type GroupRelationship = z.infer<typeof groupRelationshipSchema>;
export { groupRelationshipSchema, GroupRelationship };