Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev-deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
KartVen committed Dec 3, 2024
2 parents ad0a0e9 + fe1f901 commit cddb652
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 137 deletions.
116 changes: 75 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,5 @@
"prettier-plugin-tailwindcss": "^0.6.6",
"tailwindcss": "^3.4.1",
"typescript": "^5"
},
"overrides": {
"ajv": "^8.17.1"
}
}
5 changes: 1 addition & 4 deletions src/app/api/logout/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ export async function GET(req: NextRequest) {
const baseUrl = req.nextUrl.origin;

const headers: HeadersInit = {
'Set-Cookie': [
`${ACCESS_TOKEN_COOKIE}=; Path=/; Max-Age=0;`,
`${REFRESH_TOKEN_COOKIE}=; Path=/; Max-Age=0;`
].join(', ')
'Set-Cookie': `${ACCESS_TOKEN_COOKIE}=; Path=/; Max-Age=0;, ${REFRESH_TOKEN_COOKIE}=; Path=/; Max-Age=0;`,
};

await AuthService.logout();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ interface NotificationDropDownMenuProps {

export default function NotificationDropDownMenu({ menuClassName }: NotificationDropDownMenuProps) {
return (
<div className={`${menuClassName} w-60 bg-bg px-2 pb-2 pt-1 text-base font-normal text-secondary shadow-md`}>
</div>
<div className={`${menuClassName} w-60 bg-bg px-2 pb-2 pt-1 text-base font-normal text-secondary shadow-md`}></div>
);
}
15 changes: 5 additions & 10 deletions src/components/layout/navbar/right/UserActionBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
'use client';
import { useSessionContext } from '@/contexts/SessionContext';
import React, { useEffect, useState } from 'react';
import React from 'react';
import { TEXT } from '@/utils/constant';
import { useRouter } from 'next/navigation';
import UserActionBtns from '@/components/layout/navbar/right/UserActionBtns';

export default function UserActionBlock() {
const { session, sessionStatus } = useSessionContext();
const [stateStatus, setStateStatus] = useState(sessionStatus);
const sessionContext = useSessionContext();
const router = useRouter();

useEffect(() => {
setStateStatus(sessionStatus);
}, [sessionStatus]);

return (
<>
{stateStatus === 'UNAUTHENTICATED' && (
{sessionContext.sessionStatus === 'UNAUTHENTICATED' && (
<div className="pr-2">
<button
className="flex h-[2.5rem] cursor-pointer items-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-textOnPrimary hover:bg-primaryHover"
Expand All @@ -27,7 +22,7 @@ export default function UserActionBlock() {
</div>
)}

{stateStatus === 'AUTHENTICATED' && <UserActionBtns />}
{sessionContext.sessionStatus === 'AUTHENTICATED' && <UserActionBtns />}
</>
);
}
}
18 changes: 8 additions & 10 deletions src/components/materials/add_modal/AddMaterialModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,14 @@ export default function AddMaterialModal({ isOpen, onClose }: { isOpen: boolean;
return;
}

await MaterialService.publishMaterial(
{
title: data.details!.title,
description: data.details!.description,
link: data.details!.link,
typeId: data.sectionId!,
categoryId: data.categoryId!,
tagsIds: data.details!.tagsIds,
}
);
await MaterialService.publishMaterial({
title: data.details!.title,
description: data.details!.description,
link: data.details!.link,
typeId: data.sectionId!,
categoryId: data.categoryId!,
tagsIds: data.details!.tagsIds,
});

addToast(`Dodano materiał`, 'success', 5000);
handleClose();
Expand Down
Loading

0 comments on commit cddb652

Please sign in to comment.