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:
@@ -1,4 +1,12 @@
|
||||
import Model from './Model';
|
||||
import Model, { ModelValidator } from './Model';
|
||||
import * as yup from 'yup';
|
||||
|
||||
export const AlbumValidator = yup
|
||||
.object({
|
||||
name: yup.string().required(),
|
||||
artistId: yup.number().required(),
|
||||
})
|
||||
.concat(ModelValidator);
|
||||
|
||||
interface Album extends Model {
|
||||
name: string;
|
||||
|
||||
Reference in New Issue
Block a user