mirror of
https://github.com/ArthurDanjou/arthome.git
synced 2026-01-14 12:14:33 +01:00
Working
This commit is contained in:
13
types/auth.d.ts
vendored
13
types/auth.d.ts
vendored
@@ -18,18 +18,7 @@ declare module '#auth-utils' {
|
||||
}
|
||||
|
||||
interface UserSession {
|
||||
id: number
|
||||
name: string
|
||||
username: string
|
||||
email: string
|
||||
avatar: string | null
|
||||
githubId?: number | null
|
||||
googleId?: string | null
|
||||
description: string
|
||||
private: boolean
|
||||
language: string
|
||||
location: string
|
||||
subscription: Subscription
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ export const Subscription = ['free', 'paid'] as const
|
||||
|
||||
// Category
|
||||
export const CreateCategorySchema = z.object({
|
||||
name: z.string().min(4),
|
||||
name: z.string().min(4).max(20),
|
||||
icon: z.string(),
|
||||
color: z.enum(COLORS).default('gray'),
|
||||
nameVisible: z.boolean().optional().default(false),
|
||||
@@ -14,7 +14,7 @@ export const CreateCategorySchema = z.object({
|
||||
export const CreateCategorySchemaType = z.infer<typeof CreateCategorySchema>
|
||||
|
||||
export const UpdateCategorySchema = z.object({
|
||||
name: z.string().min(4).optional(),
|
||||
name: z.string().min(4).max(20).optional(),
|
||||
icon: z.string().optional(),
|
||||
color: z.string().optional(),
|
||||
nameVisible: z.boolean().optional().default(false),
|
||||
@@ -31,20 +31,20 @@ export interface CategoryType {
|
||||
|
||||
// Tab
|
||||
export const CreateTabSchema = z.object({
|
||||
name: z.string().min(4),
|
||||
name: z.string().min(4).max(20),
|
||||
icon: z.string(),
|
||||
color: z.enum(COLORS).default('gray'),
|
||||
primary: z.boolean().optional().default(false),
|
||||
primary: z.boolean().default(false),
|
||||
link: z.string(),
|
||||
categoryId: z.number(),
|
||||
})
|
||||
export const CreateTabSchemaType = z.infer<typeof CreateTabSchema>
|
||||
|
||||
export const UpdateTabSchema = z.object({
|
||||
name: z.string().min(4).optional(),
|
||||
name: z.string().min(4).max(20).optional(),
|
||||
icon: z.string().optional(),
|
||||
color: z.enum(COLORS).default('gray').optional(),
|
||||
primary: z.boolean().optional().default(false),
|
||||
primary: z.boolean().optional(),
|
||||
link: z.string().optional(),
|
||||
categoryId: z.number(),
|
||||
})
|
||||
@@ -60,6 +60,17 @@ export interface TabType {
|
||||
link: string
|
||||
}
|
||||
|
||||
// User
|
||||
export const UpdateUserSchema = z.object({
|
||||
name: z.string().min(3).max(25).optional(),
|
||||
username: z.string().optional(),
|
||||
description: z.string().optional(),
|
||||
location: z.string().optional(),
|
||||
language: z.string().optional(),
|
||||
private: z.boolean().optional().default(false),
|
||||
})
|
||||
export const UpdateUserSchemaType = z.infer<typeof UpdateUserSchema>
|
||||
|
||||
export interface OpenWeatherType {
|
||||
weather: Array<{
|
||||
description: string
|
||||
@@ -78,3 +89,18 @@ export interface WeatherType {
|
||||
}
|
||||
temp: number
|
||||
}
|
||||
|
||||
export const locales = [
|
||||
{
|
||||
locale: 'en-EN',
|
||||
label: 'English',
|
||||
},
|
||||
{
|
||||
locale: 'es-ES',
|
||||
label: 'Spanish',
|
||||
},
|
||||
{
|
||||
locale: 'fr-FR',
|
||||
label: 'French',
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user