Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
ubungmeister committed Nov 9, 2023
1 parent 67183e4 commit 55320d4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/app/api/member/member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const getMembers = async (options: Record<string, unknown>, _requestParam
const session = await getServerSession(authOptions);
if (!session) return;

try {
const response = await http.get<IMemberResponse[]>(`${process.env.WP_API_URL}/members`, {
data: _requestParams,
headers: { Authorization: session.wpJwtToken },
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/member/member.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface IMemberResponse {
roles?: unknown[]; // Roles assigned to the member.
capabilities?: Record<string, unknown>; // All capabilities assigned to the member.
extra_capabilities?: Record<string, unknown>; // All capabilities assigned to the member.
xprofile?: any[]; // Member xProfile groups and its fields.
xprofile?: Xprofile; // Member xProfile groups and its fields.
friendship_status?: boolean; // Whether the logged in user has a friendship relationship with the fetched user.
friendship_status_slug?: "is_friend" | "not_friends" | "pending" | "awaiting_response"; // Slug of the friendship relationship status the logged in user has with the fetched user.
last_activity?: Record<string, unknown>; // Last date the member was active on the site (object properties: timediff, date and date_gmt).
Expand Down
1 change: 0 additions & 1 deletion src/app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export const metadata: Metadata = {

export default async function Profile() {
const profile = await getCurrentMember();


if (!profile) return <div>Nebylo možné načíst data</div>;

Expand Down
6 changes: 2 additions & 4 deletions src/app/user-profile/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getMemberById } from "app/api/member/member";
import MemberProfile from "app/user-profile/components/UserProfile";
import UserProfile from "app/user-profile/components/UserProfile";

export default async function Page({ params }: { params: { id: string } }) {
const id = Number(params?.id);
Expand All @@ -8,11 +8,9 @@ export default async function Page({ params }: { params: { id: string } }) {

if (!memberData) return <div>Nebylo možné načíst data</div>;

console.log(memberData);

return (
<main className="w-full p-5">
<MemberProfile memberData={memberData} />
<UserProfile memberData={memberData} />
</main>
);
}
2 changes: 1 addition & 1 deletion src/app/user-profile/components/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const FIELD_NAMES = {
export default function UserProfile({ memberData }: UserDetailsProps) {
const [showMore, setShowMore] = useState(false);
const [showAlert, setShowAlert] = useState(false);

console.log(memberData);
const profilePhotoUrl =
memberData.avatar_urls?.full.slice(0, 4) === "http"
? memberData.avatar_urls?.full
Expand Down

0 comments on commit 55320d4

Please sign in to comment.