Skip to content

Commit

Permalink
Merge branch 'master-qa' of github.com:LucasBrazi06/ev-mobile into ma…
Browse files Browse the repository at this point in the history
…ster-qa
  • Loading branch information
LucasBrazi06 committed Nov 21, 2021
2 parents fcdf5ce + c72851f commit b4c67b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/screens/cars/AddCar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export default class AddCar extends BaseScreen<Props, State> {
autoCapitalize={'none'}
autoCorrect={false}
label={`${Constants.VIN}*`}
errorMessage={!this.checkVIN() && vin && I18n.t('cars.invalidVIN')}
errorMessage={!this.checkVIN() ? vin && I18n.t('cars.invalidVIN'): null}
errorStyle={style.errorText}
inputStyle={style.selectDropdownRowText}
onChangeText={(newVin: string) => this.setState({ vin: newVin })}
Expand All @@ -166,7 +166,7 @@ export default class AddCar extends BaseScreen<Props, State> {
autoCapitalize={'none'}
autoCorrect={false}
errorStyle={style.errorText}
errorMessage={!this.checkLicensePlate() && licensePlate && I18n.t('cars.invalidLicensePlate')}
errorMessage={!this.checkLicensePlate() ? licensePlate && I18n.t('cars.invalidLicensePlate') : null}
inputStyle={style.selectDropdownRowText}
onChangeText={(newLicensePlate: string) => this.setState({ licensePlate: newLicensePlate })}
/>
Expand Down Expand Up @@ -378,9 +378,9 @@ export default class AddCar extends BaseScreen<Props, State> {
return;
}
} catch (error) {
switch (error?.status) {
switch (error?.response?.status) {
case HTTPError.CAR_ALREADY_EXIST_ERROR:
Message.showError(I18n.t('users.carAlreadyExistError'));
Message.showError(I18n.t('cars.carAlreadyExistError'));
break;
case HTTPError.USER_ALREADY_ASSIGNED_TO_CAR:
Message.showError(I18n.t('cars.userAlreadyAssignedError'));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { DrawerActions } from '@react-navigation/native';
import { CardField, CardFieldInput, initStripe, useConfirmSetupIntent } from '@stripe/stripe-react-native';
import I18n from 'i18n-js';
import { Button, CheckBox, Spinner, View } from 'native-base';
Expand Down

0 comments on commit b4c67b1

Please sign in to comment.