From 50e7f430a6cb52f6edce887eab82c5a42952540f Mon Sep 17 00:00:00 2001 From: Pavel Date: Tue, 26 Nov 2024 12:07:14 +0500 Subject: [PATCH] chore(callcenter): DOMA-10739 move submodule to main --- apps/callcenter | 2 +- apps/condo/pages/contact/[id]/index.tsx | 9 ++++----- apps/condo/pages/ticket/[id]/index.tsx | 9 +++++---- apps/condo/pages/ticket/[id]/update.tsx | 11 +++++++---- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/apps/callcenter b/apps/callcenter index 3abea92e844..90100261117 160000 --- a/apps/callcenter +++ b/apps/callcenter @@ -1 +1 @@ -Subproject commit 3abea92e84430379908138b7f4e0ca3d4ddb0184 +Subproject commit 90100261117a154b31e460ae3c4431aa18665501 diff --git a/apps/condo/pages/contact/[id]/index.tsx b/apps/condo/pages/contact/[id]/index.tsx index a6eabb50aa6..c6b814622c9 100644 --- a/apps/condo/pages/contact/[id]/index.tsx +++ b/apps/condo/pages/contact/[id]/index.tsx @@ -211,14 +211,15 @@ export const ContactPageContent = ({ contact, isContactEditable, softDeleteActio ) } -const ContactInfoPage: PageComponentType<{ id: string }> = ({ id: contactId }) => { +const ContactInfoPage: PageComponentType = () => { const intl = useIntl() const ErrorMessage = intl.formatMessage({ id: 'errors.LoadingError' }) const LoadingMessage = intl.formatMessage({ id: 'Loading' }) const ContactNotFoundTitle = intl.formatMessage({ id: 'Contact.NotFound.Title' }) const ContactNotFoundMessage = intl.formatMessage({ id: 'Contact.NotFound.Message' }) - const { push } = useRouter() + const { push, query } = useRouter() + const { id: contactId } = query as { id: string } const { role } = useOrganization() const { persistor } = useCachePersistor() @@ -277,9 +278,7 @@ ContactInfoPage.getPrefetchedData = async ({ context, apolloClient }) => { await prefetchContact({ client: apolloClient, contactId }) return { - props: { - id: contactId, - }, + props: {}, } } diff --git a/apps/condo/pages/ticket/[id]/index.tsx b/apps/condo/pages/ticket/[id]/index.tsx index 45e9e4c83a2..898f34889cc 100644 --- a/apps/condo/pages/ticket/[id]/index.tsx +++ b/apps/condo/pages/ticket/[id]/index.tsx @@ -21,6 +21,7 @@ import isEmpty from 'lodash/isEmpty' import map from 'lodash/map' import Head from 'next/head' import Link from 'next/link' +import { useRouter } from 'next/router' import { CSSProperties, useCallback, useEffect, useMemo, useState } from 'react' import { useCachePersistor } from '@open-condo/apollo' @@ -797,12 +798,14 @@ export const TicketPageContent = ({ ticket, pollCommentsQuery, refetchTicket, or ) } -const TicketIdPage: PageComponentType<{ id: string }> = ({ id }) => { +const TicketIdPage: PageComponentType = () => { const intl = useIntl() const ServerErrorMessage = intl.formatMessage({ id: 'ServerError' }) const { user } = useAuth() const { link, organization, selectEmployee } = useOrganization() + const { query } = useRouter() + const { id } = query as { id: string } const { persistor } = useCachePersistor() @@ -898,9 +901,7 @@ TicketIdPage.getPrefetchedData = async ({ context, apolloClient }) => { await prefetchTicket({ client: apolloClient, ticketId }) return { - props: { - id: ticketId, - }, + props: {}, } } diff --git a/apps/condo/pages/ticket/[id]/update.tsx b/apps/condo/pages/ticket/[id]/update.tsx index b0c10bb004f..d995fd78fcc 100644 --- a/apps/condo/pages/ticket/[id]/update.tsx +++ b/apps/condo/pages/ticket/[id]/update.tsx @@ -1,5 +1,6 @@ import { Typography, Row, Col } from 'antd' import Head from 'next/head' +import { useRouter } from 'next/router' import React from 'react' import { useIntl } from '@open-condo/next/intl' @@ -11,10 +12,14 @@ import { TicketForm } from '@condo/domains/ticket/components/TicketForm' import { prefetchTicket } from '@condo/domains/ticket/utils/next/Ticket' -const TicketUpdatePage: PageComponentType<{ id: string }> = ({ id }) => { +const TicketUpdatePage: PageComponentType = () => { const intl = useIntl() const PageTitleMsg = intl.formatMessage({ id:'pages.condo.ticket.index.EditTicketModalTitle' }) + const router = useRouter() + const { query } = router + const { id } = query as { id: string } + return ( <> @@ -43,9 +48,7 @@ TicketUpdatePage.getPrefetchedData = async ({ context, apolloClient }) => { await prefetchTicket({ client: apolloClient, ticketId }) return { - props: { - id: ticketId, - }, + props: {}, } }