Skip to content

Commit

Permalink
Merge pull request #5 from FinleyGe/main
Browse files Browse the repository at this point in the history
fix:i18n
  • Loading branch information
FinleyGe authored Feb 28, 2025
2 parents 41e6ca7 + 85046e8 commit 3da50c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/pages/workorder/create/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import MySelect from '@/components/Select';
import { useConfirm } from '@/hooks/useConfirm';
import { useLoading } from '@/hooks/useLoading';
import { useToast } from '@/hooks/useToast';
import { WorkOrderDialog, WorkOrderEditForm } from '@/types/workorder';
import { WorkOrderEditForm } from '@/types/workorder';
import { Box, BoxProps, Center, Flex, Icon, Spinner, Text, Textarea } from '@chakra-ui/react';
import { useTranslation } from 'next-i18next';
import { useRouter } from 'next/router';
Expand All @@ -17,6 +17,7 @@ import { deleteFileByName, getFileUrl, uploadFile } from '@/api/platform';
import useSessionStore from '@/store/session';
import useEnvStore from '@/store/env';
import { getLangStore } from '@/utils/cookieUtils';
import { serviceSideProps } from '@/utils/i18n';

export default function EditOrder() {
const [errorMessage, setErrorMessage] = useState('');
Expand Down Expand Up @@ -341,3 +342,10 @@ export default function EditOrder() {
</Box>
);
}
export async function getServerSideProps(content: any) {
return {
props: {
...(await serviceSideProps(content))
}
};
}
2 changes: 0 additions & 2 deletions src/pages/workorders/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ import useEnvStore from '@/store/env';
import { getLangStore } from '@/utils/cookieUtils';

function Home() {
// const { Loading } = useLoading();
const { SystemEnv } = useEnvStore();
const { t } = useTranslation();
// const [initialized, setInitialized] = useState(false);
const router = useRouter();
const [page, setPage] = useState(() => {
const queryPage = Number(router.query.page);
Expand Down

0 comments on commit 3da50c5

Please sign in to comment.