Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hola-soy-milk committed Oct 29, 2023
1 parent 7a0162a commit 2cb2e33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion guest-list-mobile/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function HomeLayout() {
return (
<View style={styles.container}>
<Header label={label} />
<StatusBar style="auto" />
<StatusBar style="auto" /> {/* eslint-disable-line*/}
<View style={styles.slot}>
<Slot />
</View>
Expand Down
7 changes: 5 additions & 2 deletions guest-list-mobile/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,18 @@ export default function Index() {
}

async function postGuest(guest: { firstName: string; lastName: string }) {
const { firstName, lastName } = guest;

Check warning on line 55 in guest-list-mobile/app/index.tsx

View workflow job for this annotation

GitHub Actions / Lint, Check Types

'firstName' is already declared in the upper scope on line 40 column 11

Check warning on line 55 in guest-list-mobile/app/index.tsx

View workflow job for this annotation

GitHub Actions / Lint, Check Types

'lastName' is already declared in the upper scope on line 40 column 22
const response = await fetch(`${API_URL}/guests`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ firstName, lastName }),
});
const newGuest: Guest = await response.json();
setGuests([...guests, newGuest]);
try {
const newGuest: Guest = await response.json();
setGuests([...guests, newGuest]);
} catch {}
}
if (typeof firstName === 'string' && typeof lastName === 'string') {
postGuest({ firstName, lastName });

Check warning on line 69 in guest-list-mobile/app/index.tsx

View workflow job for this annotation

GitHub Actions / Lint, Check Types

Promises must be awaited, end with a call to .catch, or end with a call to .then with a rejection handler
Expand Down

0 comments on commit 2cb2e33

Please sign in to comment.