Skip to content

Commit

Permalink
Merge pull request #61 from gdsc-ssu/fix/#60
Browse files Browse the repository at this point in the history
fix: 예약확인 오류 해결
  • Loading branch information
Jun99uu authored Jan 4, 2024
2 parents 07bba8a + 17e93b8 commit 553420b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/apis/ReserveData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ReservationData } from '@/@types/ReservationList';
import axios from 'axios';

export const getReservationData = async (AccessToken?: string) => {
const apiUrl = `${process.env.NEXT_PUBLIC_RESERVATION_CHECK}`;
const apiUrl = `${process.env.NEXT_PUBLIC_RESERVATION_CHECK}?includeCompanion=true`;
const headers = {
Accept: 'application/json, text/plain, */*',
'pyxis-auth-token': `${AccessToken}`, //로그인 후 발급받은 토큰
Expand Down
15 changes: 14 additions & 1 deletion client/src/components/ReservationCheck/ReservationItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ interface Props {
endTime: string;
room: string;
patrons: PatronInfo[];
patron: string;
authName: string;
reserveId: number;
}

Expand All @@ -28,6 +30,8 @@ const ReservationItem = ({
endTime,
room,
patrons,
patron,
authName,
reserveId,
}: Props) => {
const { isMount, handleOpen, handleClose, isTransition } = useTransition();
Expand Down Expand Up @@ -80,7 +84,14 @@ const ReservationItem = ({
</TitleBox>
<div>
<DateBox>{formatDateRange(beginTime, endTime)}</DateBox>
<PlaceBox>{room}</PlaceBox>
<PlaceBox>
{room}
{patron !== authName && (
<PersonInfo style={{ backgroundColor: 'transparent' }}>
{' 예약자: ' + patron}
</PersonInfo>
)}
</PlaceBox>
<PeopleBox>
{patrons.map((el, idx) => {
return (
Expand Down Expand Up @@ -143,6 +154,8 @@ const DateBox = styled.div`
const PlaceBox = styled.div`
margin-top: 5px;
${TYPO.text3.Reg};
display: flex;
align-items: center;
`;

const PeopleBox = styled.div`
Expand Down
2 changes: 2 additions & 0 deletions client/src/components/ReservationCheck/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ const ReservationCheck = () => {
endTime={el.endTime}
room={el.room.name}
patrons={el.patrons}
patron={el.patron.name}
reserveId={el.id}
authName={authInfo?.name}
/>
</ListBox>
))
Expand Down

0 comments on commit 553420b

Please sign in to comment.