mirror of
https://github.com/BradNut/weddingsite
synced 2025-09-08 17:40:36 +00:00
ESLint exceptions and safety on optional chaining.
This commit is contained in:
parent
f9b5f3f4ba
commit
01ac00eda7
2 changed files with 52 additions and 46 deletions
|
|
@ -34,7 +34,7 @@ export default withSession(async (req, res) => {
|
|||
// console.log('group', group);
|
||||
response.id = id;
|
||||
const guestList = [];
|
||||
for (const guestId of group?.guests) {
|
||||
for (const guestId of group?.guests || []) {
|
||||
// console.log(JSON.stringify(guestId));
|
||||
const guestData = await Guest.findById(guestId);
|
||||
const guest = {
|
||||
|
|
|
|||
|
|
@ -297,7 +297,9 @@ export default function SingleGroupPage({ group }) {
|
|||
gap: '1rem',
|
||||
}}
|
||||
>
|
||||
{group?.guests?.map((guest) =>
|
||||
{
|
||||
// eslint-disable-next-line react/prop-types
|
||||
group?.guests?.map((guest) =>
|
||||
!guest.isPlusOne ? (
|
||||
<QuestionStyles key={`${guest?.id}-dietaryNotes`}>
|
||||
<p>
|
||||
|
|
@ -319,7 +321,8 @@ export default function SingleGroupPage({ group }) {
|
|||
) : (
|
||||
''
|
||||
)
|
||||
)}
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset aria-busy={loading} disabled={loading}>
|
||||
|
|
@ -330,7 +333,9 @@ export default function SingleGroupPage({ group }) {
|
|||
gap: '1rem',
|
||||
}}
|
||||
>
|
||||
{group?.guests?.map((guest) =>
|
||||
{
|
||||
// eslint-disable-next-line react/prop-types
|
||||
group?.guests?.map((guest) =>
|
||||
!guest?.isPlusOne ? (
|
||||
<QuestionStyles key={`${guest?.id}-songRequests`}>
|
||||
<p>
|
||||
|
|
@ -352,7 +357,8 @@ export default function SingleGroupPage({ group }) {
|
|||
) : (
|
||||
''
|
||||
)
|
||||
)}
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset aria-busy={loading} disabled={loading}>
|
||||
|
|
@ -436,7 +442,7 @@ export async function getServerSideProps({ params }) {
|
|||
|
||||
group.id = params.id;
|
||||
const guestList = [];
|
||||
for (const guestId of groupData?.guests) {
|
||||
for (const guestId of groupData?.guests || []) {
|
||||
const guestData = await Guest.findById(guestId);
|
||||
const guest = {
|
||||
id: guestData.id,
|
||||
|
|
|
|||
Loading…
Reference in a new issue