Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

feat(interview-scheduler): model updates based on updated schema #250

Merged
merged 1 commit into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,16 @@ function InterviewDetailsPopup({ open, onClose, candidate, openNext }) {

const onSubmitCallback = useCallback(
async (formData) => {
const attendeesList =
formData.emails?.filter(
(email) => typeof email === "string" && email.length > 0
) || [];
const hostEmail = formData.emails[0];
const guestEmails =
formData.emails
.slice(1)
.filter((email) => typeof email === "string" && email.length > 0) ||
[];
const interviewData = {
xaiTemplate: formData.time,
attendeesList,
templateUrl: formData.time,
hostEmail,
guestEmails,
};

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ import Accordion from "components/Accordion";
import "./styles.module.scss";

function PrevInterviewItem(props) {
const { date, round, emails } = props;
const { date, round, hostEmail, guestEmails } = props;

return (
<Accordion
title={`Interview Round ${round}`}
subhead={formatDate(date)}
sidebar={`${emails.length} Attendees`}
sidebar={`${guestEmails.length + 1} Attendees`}
>
<ul>
{emails.map((email) => (
<li styleName="email">{hostEmail}</li>
{guestEmails.map((email) => (
<li styleName="email">{email}</li>
))}
</ul>
Expand All @@ -30,7 +31,8 @@ function PrevInterviewItem(props) {
PrevInterviewItem.propTypes = {
date: PT.string.isRequired,
round: PT.number.isRequired,
emails: PT.arrayOf(PT.string).isRequired,
hostEmail: PT.string.isRequired,
guestEmails: PT.arrayOf(PT.string).isRequired,
};

export default PrevInterviewItem;
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ function PreviousInterviewsPopup(props) {
key={interview.id}
round={interview.round}
date={interview.startTimestamp}
emails={interview.attendeesList}
hostEmail={interview.hostEmail}
guestEmails={interview.guestEmails}
/>
));
};
Expand Down