dev smartfarming #1
|
|
@ -27,6 +27,9 @@ export const httpErrorInterceptor: HttpInterceptorFn = (req, next) => {
|
|||
case 404:
|
||||
errorMessage = 'Resource not found: The requested resource does not exist.';
|
||||
break;
|
||||
case 422:
|
||||
errorMessage = 'Enter a different username or email';
|
||||
break;
|
||||
case 500:
|
||||
errorMessage = 'Server error: Please try again later.';
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,17 @@ export class RegisterComponent implements OnInit {
|
|||
this.loading = false;
|
||||
this.toast.error('Please fill in all fields.');
|
||||
return;
|
||||
} else if(this.password.length<8){
|
||||
this.loading= false;
|
||||
this.toast.error('Password must be at least 8 characters')
|
||||
} else if(!this.email.includes('@')){
|
||||
this.loading=false;
|
||||
this.toast.error('Invalid Email');
|
||||
} else {
|
||||
(error: any) => {
|
||||
this.loading = false;
|
||||
this.toast.error(error.error.message);
|
||||
}
|
||||
}
|
||||
|
||||
const registrationData: RegistrationData = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user