Add api source

This commit is contained in:
Geomitron
2024-05-04 03:20:54 -05:00
parent d57d8bcc9f
commit 3f72d21470
3 changed files with 6 additions and 0 deletions

View File

@@ -3,11 +3,14 @@ import { z } from 'zod'
import { difficulties, instruments, Overwrite } from '../UtilFunctions'
export const sources = ['website', 'bridge'] as const
export const GeneralSearchSchema = z.object({
search: z.string(),
page: z.number().positive(),
instrument: z.enum(instruments).nullable(),
difficulty: z.enum(difficulties).nullable(),
source: z.enum(sources).optional(),
})
export type GeneralSearch = z.infer<typeof GeneralSearchSchema>
@@ -22,6 +25,7 @@ export const AdvancedSearchSchema = z.object({
return true
}, { message: 'Invalid instrument list' }).nullable(),
difficulty: z.enum(difficulties).nullable(),
source: z.enum(sources).optional(),
name: z.object({ value: z.string(), exact: z.boolean(), exclude: z.boolean() }),
artist: z.object({ value: z.string(), exact: z.boolean(), exclude: z.boolean() }),
album: z.object({ value: z.string(), exact: z.boolean(), exclude: z.boolean() }),