Skip to content

Commit

Permalink
fix: remove warnings (#1256)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmonnier9 authored Oct 8, 2024
1 parent d57d3ce commit 1178bb9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 49 deletions.
39 changes: 0 additions & 39 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,6 @@
"allow": ["warn", "error"]
}
],
"import/order": [
"warn",
{
"pathGroupsExcludedImportTypes": ["builtin"],
"pathGroups": [
{
"group": "internal",
"pattern": "#clients/**"
},
{
"group": "internal",
"pattern": "#components/**"
},
{
"group": "internal",
"pattern": "#components-ui/**"
},
{
"group": "internal",
"pattern": "#models/**"
},
{
"group": "internal",
"pattern": "#public/*"
},
{
"group": "internal",
"pattern": "#utils/*"
}
],
"newlines-between": "never",
"groups": [
"builtin",
"external",
"internal",
["parent", "sibling", "index"]
]
}
],
"@next/next/no-css-tags": "off",
"@next/next/no-head-element": "off",
"@next/next/no-html-link-for-pages": "off",
Expand Down
2 changes: 0 additions & 2 deletions app/(header-default)/carte/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { getEtablissementWithLatLongFromSlug } from '#models/core/etablissement'
import extractParamsAppRouter, {
AppRouterProps,
} from '#utils/server-side-helper/app/extract-params';
import getSession from '#utils/server-side-helper/app/get-session';

export const generateMetadata = async (
props: AppRouterProps
Expand All @@ -26,7 +25,6 @@ export const generateMetadata = async (

const EtablissementMapPage = async (props: AppRouterProps) => {
const { slug } = extractParamsAppRouter(props);
const session = await getSession();
const etablissement = await getEtablissementWithLatLongFromSlug(slug);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function DirigeantContent({
const defaultDenom = dirigeant.denomination || dirigeant.siren;
//@ts-ignore
infos.push([
<a href={`/dirigeants/${dirigeant.siren}`}>
<a key={dirigeant.siren} href={`/dirigeants/${dirigeant.siren}`}>
→ voir les dirigeants de {defaultDenom}
</a>,
]);
Expand Down
4 changes: 1 addition & 3 deletions app/(header-default)/lp/agent-public/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { IronSession } from 'iron-session';
import { Metadata } from 'next';
import { default as ButtonProConnect } from '#components-ui/button-pro-connect';
import Container from '#components-ui/container';
Expand All @@ -19,14 +18,13 @@ export const metadata: Metadata = {
},
};

const isLoggedInMessage = (session: IronSession<ISession> | null) => (
const isLoggedInMessage = (session: ISession | null) => (
<div>
Vous êtes connecté en tant que : <strong>{session?.user?.email}</strong>
</div>
);

const LandingPageAgent = async (props: AppRouterProps) => {
const { pathFrom } = props.searchParams;
const session = await getSession();

return (
Expand Down
9 changes: 5 additions & 4 deletions utils/server-side-helper/app/get-session.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { getIronSession, IronSession } from 'iron-session';
import { cookies } from 'next/headers';
import { ISession } from '#models/user/session';
import { sessionOptions } from '#utils/session';
import { getIronSession } from 'iron-session';
import { cookies } from 'next/headers';

export default async function getSession(): Promise<IronSession<ISession> | null> {
return await getIronSession<ISession>(cookies(), sessionOptions);
export default async function getSession(): Promise<ISession | null> {
const ironSession = await getIronSession<ISession>(cookies(), sessionOptions);
return { ...ironSession };
}

0 comments on commit 1178bb9

Please sign in to comment.