diff --git a/apps/api/src/user/service/user.service.ts b/apps/api/src/user/service/user.service.ts index eb0cb0a8..8a45be10 100644 --- a/apps/api/src/user/service/user.service.ts +++ b/apps/api/src/user/service/user.service.ts @@ -15,6 +15,7 @@ import { generateOtp, limitMaxItemsPerPage } from '@/common/util' import { createUser } from '@/common/user' import { CacheService } from '@/cache/cache.service' import { UserWithWorkspace } from '../user.types' +import { UpdateSelfRequest } from '@keyshade/schema' @Injectable() export class UserService { @@ -44,7 +45,7 @@ export class UserService { } async updateSelf(user: UserWithWorkspace, dto: UpdateUserDto) { - const data = { + const data: UpdateSelfRequest = { name: dto?.name, profilePictureUrl: dto?.profilePictureUrl, isOnboardingFinished: dto.isOnboardingFinished diff --git a/apps/platform/public/svg/shared/index.ts b/apps/platform/public/svg/shared/index.ts index 0d09dde2..64eb64d2 100644 --- a/apps/platform/public/svg/shared/index.ts +++ b/apps/platform/public/svg/shared/index.ts @@ -8,7 +8,7 @@ import ThreeDotOptionSVG from './3dotOption.svg' import AddSVG from './add.svg' import LoadingSVG from './loading.svg' import MessageSVG from './message.svg' -import VectorSVG from './vector.svg' +import VectorSVG from './Vector.svg' import ErrorSVG from './Error.svg' export { diff --git a/apps/platform/src/app/(main)/settings/@profile/page.tsx b/apps/platform/src/app/(main)/settings/@profile/page.tsx index ac8060c0..e5f61ef4 100644 --- a/apps/platform/src/app/(main)/settings/@profile/page.tsx +++ b/apps/platform/src/app/(main)/settings/@profile/page.tsx @@ -15,13 +15,14 @@ function ProfilePage(): React.JSX.Element { profilePictureUrl: '' }) const [isModified, setIsModified] = useState(false) + const [email, setEmail] = useState('') const updateSelf = useCallback(async () => { try { await ControllerInstance.getInstance().userController.updateSelf( { name: userData.name, - email: userData.email + email: userData.email === email ? null : email }, {} ) @@ -31,7 +32,7 @@ function ProfilePage(): React.JSX.Element { console.error(error) } setIsModified(false) - }, [userData]) + }, [userData, email]) useEffect(() => { ControllerInstance.getInstance() @@ -43,6 +44,7 @@ function ProfilePage(): React.JSX.Element { name: data.name, profilePictureUrl: data.profilePictureUrl || '' }) + setEmail(data.email) setIsLoading(false) } else { // eslint-disable-next-line no-console -- we need to log the error @@ -104,10 +106,10 @@ function ProfilePage(): React.JSX.Element { disabled // onChange={(e: React.ChangeEvent) => { // setIsModified(true) - // setUserData((prev) => ({ ...prev, email: e.target.value })) + // setEmail(e.target.value) // }} placeholder="email" - value={userData.email} + value={email} /> )}