Skip to content

Commit

Permalink
feat: update nextjs to v15
Browse files Browse the repository at this point in the history
  • Loading branch information
Shchepotin committed Dec 31, 2024
1 parent b44b866 commit cbf7b44
Show file tree
Hide file tree
Showing 36 changed files with 2,207 additions and 1,408 deletions.
2 changes: 1 addition & 1 deletion .hygen/generate/resource/create/page-content.ejs.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import FormTextInput from "@/components/form/text-input/form-text-input";
import * as yup from "yup";
import { yupResolver } from "@hookform/resolvers/yup";
import withPageRequiredAuth from "@/services/auth/with-page-required-auth";
import { useSnackbar } from "notistack";
import { useSnackbar } from "@/hooks/use-snackbar";
import Link from "@/components/link";
import useLeavePage from "@/services/leave-page/use-leave-page";
import Box from "@mui/material/Box";
Expand Down
8 changes: 6 additions & 2 deletions .hygen/generate/resource/create/page.ejs.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ type Props = {
params: { language: string };
};

export async function generateMetadata({ params }: Props): Promise<Metadata> {
export async function generateMetadata(props: Props): Promise<Metadata> {
const params = await props.params;

const { t } = await getServerTranslation(
params.language,
"admin-panel-<%= h.inflection.transform(name, ['pluralize', 'underscore', 'dasherize']) %>-create"
Expand All @@ -20,4 +22,6 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
};
}

export default Create<%= name %>;
export default function Page() {
return <Create<%= name %> />;
}
6 changes: 3 additions & 3 deletions .hygen/generate/resource/edit/page-content.ejs.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import FormTextInput from "@/components/form/text-input/form-text-input";
import * as yup from "yup";
import { yupResolver } from "@hookform/resolvers/yup";
import withPageRequiredAuth from "@/services/auth/with-page-required-auth";
import { useSnackbar } from "notistack";
import { useSnackbar } from "@/hooks/use-snackbar";
import Link from "@/components/link";
import useLeavePage from "@/services/leave-page/use-leave-page";
import Box from "@mui/material/Box";
Expand Down Expand Up @@ -60,8 +60,8 @@ function EditFormActions() {

function FormEdit() {
const router = useRouter();
const params = useParams();
const entityId = Array.isArray(params.id) ? params.id[0] : params.id;
const params = useParams<{ id: string }>();
const entityId = params.id;
const fetchEdit<%= name %> = useEdit<%= name %>Service();
const { t } = useTranslation("admin-panel-<%= h.inflection.transform(name, ['pluralize', 'underscore', 'dasherize']) %>-edit");
const validationSchema = useValidationSchema();
Expand Down
8 changes: 6 additions & 2 deletions .hygen/generate/resource/edit/page.ejs.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ type Props = {
params: { language: string };
};

export async function generateMetadata({ params }: Props): Promise<Metadata> {
export async function generateMetadata(props: Props): Promise<Metadata> {
const params = await props.params;

const { t } = await getServerTranslation(
params.language,
"admin-panel-<%= h.inflection.transform(name, ['pluralize', 'underscore', 'dasherize']) %>-edit"
Expand All @@ -20,4 +22,6 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
};
}

export default Edit<%= name %>;
export default function Page() {
return <Edit<%= name %> />;
}
8 changes: 6 additions & 2 deletions .hygen/generate/resource/page.ejs.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ type Props = {
params: { language: string };
};

export async function generateMetadata({ params }: Props): Promise<Metadata> {
export async function generateMetadata(props: Props): Promise<Metadata> {
const params = await props.params;

const { t } = await getServerTranslation(
params.language,
"admin-panel-<%= h.inflection.transform(name, ['pluralize', 'underscore', 'dasherize']) %>"
Expand All @@ -20,4 +22,6 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
};
}

export default <%= h.inflection.transform(name, ['pluralize']) %>;
export default function Page() {
return <<%= h.inflection.transform(name, ['pluralize']) %> />;
}
Loading

0 comments on commit cbf7b44

Please sign in to comment.