Skip to content

Commit

Permalink
change: use ProfileClass on ManageProfile
Browse files Browse the repository at this point in the history
  • Loading branch information
NiiMiyo committed Dec 2, 2023
1 parent 0190028 commit 0c60c4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/pages/ManageProfile/ManageProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Navigate, useLoaderData, useNavigate } from "react-router-dom";
import UniversimeApi from "@/services/UniversimeApi";
import { ManageProfileLinks, ManageProfileLoaderResponse, ManageProfilePassword, ManageProfileImage, getManageLinks, getProfileImage } from "@/pages/ManageProfile";
import { setStateAsValue } from "@/utils/tsxUtils";
import { getProfileImageUrl } from "@/utils/profileUtils";
import { AuthContext } from "@/contexts/Auth";
import * as SwalUtils from "@/utils/sweetalertUtils";

Expand Down Expand Up @@ -38,7 +37,7 @@ export function ManageProfilePage() {
<div id="left-side">
<form id="profile-edit" className="card">
<div className="image-name-container">
<ManageProfileImage currentImage={getProfileImageUrl(profile)} />
<ManageProfileImage currentImage={profile.imageUrl} />

<fieldset id="fieldset-name">
<legend>Altere seu nome</legend>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/ManageProfile/loader.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import UniversimeApi from "@/services/UniversimeApi";
import { type Gender, type Profile, GENDER_OPTIONS } from "@/types/Profile";
import { type Gender, ProfileClass, GENDER_OPTIONS } from "@/types/Profile";
import { Link, TypeLink, TypeLinkToLabel } from "@/types/Link";

export type ManageProfileLoaderResponse = {
profile: Profile | null;
profile: ProfileClass | null;
links: Link[];

genderOptions: {
Expand Down Expand Up @@ -45,7 +45,7 @@ export async function ManageProfileLoader(): Promise<ManageProfileLoaderResponse
: [];

return {
profile,
profile: profile ? new ProfileClass(profile) : null,
links,
genderOptions,
typeLinks,
Expand Down

0 comments on commit 0c60c4c

Please sign in to comment.