10d1342294
* 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
9 lines
198 B
TypeScript
9 lines
198 B
TypeScript
import * as yup from 'yup';
|
|
|
|
type ResponseHandler<APIType, ModelType = APIType> = {
|
|
validator: yup.Schema<APIType>;
|
|
transformer: (value: APIType) => ModelType;
|
|
};
|
|
|
|
export default ResponseHandler;
|