Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
yeolyi committed Mar 9, 2025
1 parent 8a8ea15 commit 858685e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions actions/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ export const getUserState = async (): Promise<UserState> => {
if (id === undefined) return 'logout';

try {
const resp = await getMyRole();
return resp.roles[0];
const { roles } = await getMyRole();
if (roles.includes('ROLE_STAFF')) return 'ROLE_STAFF';
if (roles.includes('ROLE_RESERVATION')) return 'ROLE_RESERVATION';
if (roles.includes('ROLE_COUNCIL')) return 'ROLE_COUNCIL';
return 'logout';
} catch {
removeAuthCookie();
return 'logout';
Expand Down
2 changes: 2 additions & 0 deletions app/[locale]/about/facilities/FacilitiesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { handleServerResponse } from '@/utils/serverActionError';
const facilitiesPath = getPath(facilities);

export default function FacilitesList({ facilities }: { facilities: Facility[] }) {
console.log(facilities);

return (
<div className="mt-[-20px] flex flex-col divide-y divide-neutral-200">
{facilities.map((facility) => (
Expand Down

0 comments on commit 858685e

Please sign in to comment.