fix linting errors

This commit is contained in:
leander committed 2024-08-01 17:24:33 +02:00
1 parent 09497313f2
commit 54a0466de7
6 files changed
+8 -11

No files matched your search

+3 -3
View File
@@ -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,
}),
})
+2 -2
View File
@@ -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 (
+1 -1
View File
@@ -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');
}
+1 -3
View File
@@ -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>
+1 -1
View File
@@ -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,
-1
View File
@@ -11,7 +11,6 @@ import {
REGISTER_USER_SUCCESS,
} from './actions';
import type { UserType } from './types/data';
import { snakeToCamelCase } from './utils';
interface RootState {
isAuthenticated: boolean;