Front: Api models validation (#245)
* Front: Model: Write Validators * Front: Plage response validator * Front: API: Typing 'fetch' return * Front: Basic Models: Response Handlers * Front: API: Validate authentication response * Front: Validate Search History * Front: Validate Responses of User updates * Front: On Validation Error, more verbose console error
This commit is contained in:
+19
-13
@@ -1,15 +1,21 @@
|
||||
type Skill =
|
||||
| 'rhythm'
|
||||
| 'two-hands'
|
||||
| 'combos'
|
||||
| 'arpeggio'
|
||||
| 'distance'
|
||||
| 'left-hand'
|
||||
| 'right-hand'
|
||||
| 'lead-head-change'
|
||||
| 'chord-complexity'
|
||||
| 'chord-timing'
|
||||
| 'pedal'
|
||||
| 'precision';
|
||||
import * as yup from 'yup';
|
||||
|
||||
const Skills = [
|
||||
'rhythm',
|
||||
'two-hands',
|
||||
'combos',
|
||||
'arpeggio',
|
||||
'distance',
|
||||
'left-hand',
|
||||
'right-hand',
|
||||
'lead-head-change',
|
||||
'chord-complexity',
|
||||
'chord-timing',
|
||||
'pedal',
|
||||
'precision',
|
||||
] as const;
|
||||
type Skill = (typeof Skills)[number];
|
||||
|
||||
export const SkillValidator = yup.mixed<Skill>().oneOf(Skills);
|
||||
|
||||
export default Skill;
|
||||
|
||||
Reference in New Issue
Block a user