Skip to content

Commit

Permalink
feat: 공연 생성 이후 이동 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
alstn2468 committed Dec 14, 2024
1 parent 6f2e5f9 commit 93ab66d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions apps/admin/src/pages/ShowAddPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import Styled from './ShowAddPage.styles';
import ShowCastInfoFormContent from '~/components/ShowInfoFormContent/ShowCastInfoFormContent';
import ShowCastInfo from '~/components/ShowCastInfo';
import { TempShowCastInfoFormInput } from '~/components/ShowCastInfoFormDialogContent';
import { checkIsWebView } from '@boolti/bridge';
import { checkIsWebView, isWebViewBridgeAvailable, navigateToShowDetail } from '@boolti/bridge';
import useCastTeamListOrder from '~/hooks/useCastTeamListOrder';

interface ShowAddPageProps {
Expand All @@ -38,7 +38,7 @@ interface ShowAddPageProps {

const ShowAddPage = ({ step }: ShowAddPageProps) => {
const navigate = useNavigate();
const isWebView = checkIsWebView(window.navigator.userAgent);
const isWebView = checkIsWebView();

const [imageFiles, setImageFiles] = useState<ImageFile[]>([]);
const [salesTicketList, setSalesTicketList] = useState<SalesTicket[]>([]);
Expand Down Expand Up @@ -66,7 +66,7 @@ const ShowAddPage = ({ step }: ShowAddPageProps) => {
const showImageInfo = await uploadShowImageMutation.mutateAsync(imageFiles);

// 공연 생성
await addShowMutation.mutateAsync({
const showId = await addShowMutation.mutateAsync({
name: showInfoForm.getValues('name'),
images: showImageInfo,
date: `${showInfoForm.getValues('date')}T${showInfoForm.getValues('startTime')}:00.000Z`,
Expand Down Expand Up @@ -104,6 +104,11 @@ const ShowAddPage = ({ step }: ShowAddPageProps) => {
})) as ShowCastTeamCreateOrUpdateRequest[],
});

if (isWebView && isWebViewBridgeAvailable()) {
navigateToShowDetail({ showId });
return;
}

navigate(PATH.SHOW_ADD_COMPLETE);
};

Expand Down

0 comments on commit 93ab66d

Please sign in to comment.