This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
website/models/Member.ts

21 lines
551 B
TypeScript
Raw Permalink Normal View History

2022-08-31 21:44:33 +02:00
import type { Static } from '@sinclair/typebox'
import { Type } from '@sinclair/typebox'
import { date, id } from './utils'
2022-08-31 21:44:33 +02:00
import type { UserPublicWithoutSettings } from './User'
export const memberSchema = {
id,
isOwner: Type.Boolean({ default: false }),
createdAt: date.createdAt,
updatedAt: date.updatedAt,
userId: id,
guildId: id
}
const memberObjectSchema = Type.Object(memberSchema)
export type Member = Static<typeof memberObjectSchema>
export interface MemberWithPublicUser extends Member {
user: UserPublicWithoutSettings
}