fix linting errors
This commit is contained in:
6 files changed
+8
-11
No files matched your search
+3
-3
@@ -91,10 +91,10 @@ export function requestRegisterUser({ first_name, last_name, email, phone_number
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
first_name: first_name,
|
||||
last_name: last_name,
|
||||
first_name,
|
||||
last_name,
|
||||
email,
|
||||
phone_number: phone_number,
|
||||
phone_number,
|
||||
password,
|
||||
}),
|
||||
})
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Text, StyleSheet, View } from 'react-native';
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const FormErrors = ({ errors }: { errors: Record<string, any> }) => {
|
||||
if (!errors) {
|
||||
return;
|
||||
return [];
|
||||
}
|
||||
|
||||
let errorFormatted;
|
||||
@@ -20,7 +20,7 @@ const FormErrors = ({ errors }: { errors: Record<string, any> }) => {
|
||||
}
|
||||
|
||||
if (!errorFormatted) {
|
||||
return;
|
||||
return [];
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -65,7 +65,7 @@ const useEventList = () => {
|
||||
let eventData;
|
||||
try {
|
||||
const res = await fetchWithTimeout(url);
|
||||
if (res.status == 418) {
|
||||
if (res.status === 418) {
|
||||
// TODO: temporary. Remove once new website is up and running
|
||||
throw new Error('I am a teapot');
|
||||
}
|
||||
|
||||
@@ -79,9 +79,7 @@ const UserRegister = () => {
|
||||
returnKeyType="send"
|
||||
onSubmitEditing={onSubmit}
|
||||
/>
|
||||
<View style={styles.errorBox}>
|
||||
{registerError && isSubmitted && <FormErrors errors={registerError} />}
|
||||
</View>
|
||||
<View style={styles.errorBox}>{registerError && isSubmitted && <FormErrors errors={registerError} />}</View>
|
||||
<Button fullWidth disabled={isDisabled} onPress={onSubmit} style={styles.registerButton} type="submit">
|
||||
<Text>Registrer meg</Text>
|
||||
</Button>
|
||||
|
||||
@@ -64,7 +64,7 @@ const useUserRegister = () => {
|
||||
Object.keys(registerError).forEach((key) => {
|
||||
setError(key as keyof UserRegisterFormValues, { type: 'server', message: registerError[key].join('\n') });
|
||||
});
|
||||
}, [registerError]);
|
||||
}, [registerError, isSubmitted, clearErrors, setError]);
|
||||
|
||||
return {
|
||||
isRegisteringUser,
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
REGISTER_USER_SUCCESS,
|
||||
} from './actions';
|
||||
import type { UserType } from './types/data';
|
||||
import { snakeToCamelCase } from './utils';
|
||||
|
||||
interface RootState {
|
||||
isAuthenticated: boolean;
|
||||
|
||||
Reference in new issue
Block a user