DB, Collections, Search
This commit is contained in:
41
src/types/index.ts
Normal file
41
src/types/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
// Standard Server Action result type
|
||||
export type ActionResult<T = void> = {
|
||||
success: boolean
|
||||
data?: T
|
||||
message?: string
|
||||
errors?: Record<string, string[]>
|
||||
}
|
||||
|
||||
// User types
|
||||
export type UserRole = 'USER' | 'ADMIN' | 'MODERATOR'
|
||||
|
||||
export type SafeUser = {
|
||||
id: string
|
||||
email: string
|
||||
name: string | null
|
||||
role: UserRole
|
||||
isActive: boolean
|
||||
createdAt: Date
|
||||
}
|
||||
|
||||
// Auth types
|
||||
export type LoginCredentials = {
|
||||
email: string
|
||||
password: string
|
||||
}
|
||||
|
||||
export type RegisterData = {
|
||||
email: string
|
||||
password: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export type UpdatePasswordData = {
|
||||
currentPassword: string
|
||||
newPassword: string
|
||||
}
|
||||
|
||||
export type UpdateProfileData = {
|
||||
name?: string
|
||||
email?: string
|
||||
}
|
||||
Reference in New Issue
Block a user