Skip to content

feat: update profile #150

Merged
dahal merged 27 commits into
captableinc:mainfrom
Raju-kadel-27:feat/complete-profile-setup
Mar 1, 2024
Merged

feat: update profile #150
dahal merged 27 commits into
captableinc:mainfrom
Raju-kadel-27:feat/complete-profile-setup

Conversation

@Raju-kadel-27
Copy link
Copy Markdown
Contributor

PR for issue #139

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 24, 2024

Thank you for following the naming conventions for pull request titles! 🙏

@Raju-kadel-27 Raju-kadel-27 changed the title feat:update-profile-procedure feat: update profile procedure Feb 24, 2024
@Raju-kadel-27 Raju-kadel-27 changed the title feat: update profile procedure feat: update profile Feb 24, 2024
@Raju-kadel-27 Raju-kadel-27 marked this pull request as ready for review February 28, 2024 14:11
@Raju-kadel-27
Copy link
Copy Markdown
Contributor Author

@dahal @chetannn I think it's ready for review.

where: {
status: "ACTIVE",
id: user.memberId,
companyId: user.companyId,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filtering by companyId is not necessary here.

FormLabel,
FormMessage,
} from "@/components/ui/form";
const profileSettingsSchema = z.object({
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this schema to a dedicated file so that it can be used on the backend as well.

const [file, setFile] = useState<File | null>(null);
const fileInputRef = useRef<HTMLInputElement>(null);

// @ts-expect-error: xxxx
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this comment

resolver: zodResolver(profileSettingsSchema),
});

// @ts-expect-error: xxxx
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

},
});

useEffect(() => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to fetch data initially from the server component and pass the profile as prop. useEffect is redundant here.

}
}, [memberProfile?.data, form]);

const handleImageUpload = async (
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this unused function.

const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const files = event.target.files;

if (files?.[0]) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract the file validation logic to a utils.

const handleRemoveAvatar = () => {
setFile(null);
};
async function onSubmit(values: z.infer<typeof profileSettingsSchema>) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing a profile picture and saving profile information are two different actions like I said the day before. Clicking on save button should only save the profile information.

Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have requested for some changes. Awesome work BTW

@Raju-kadel-27
Copy link
Copy Markdown
Contributor Author

@chetannn I think I fixed the requested changes ??

@dahal dahal merged commit 879ea5d into captableinc:main Mar 1, 2024
@Raju-kadel-27 Raju-kadel-27 deleted the feat/complete-profile-setup branch March 1, 2024 06:17
zeekay pushed a commit to hanzoai/captable that referenced this pull request Mar 10, 2026
* feat:update-profile-procedure

* feat:zod schema for update profile input

* feat: get-user-profile-procedure

* feat: edit-profile-page

* update to update-profile-procedures

* get-profile-procedure updated

* member-router schema update

* env changes

* new routers registered in root member router

* session-sync-with-profile-update

* update: profile-page

* update: procedure-upatate-profile

* update: schema-member-router

* update: server/auth

* minor fix

* feat: added bucketMode props to s3 uploader

* minor fix

* minor change in payload-action-type enum

* types

* added zod-schemas

* fix: member-router-schema

* update: profile-page

* update: update-profile-procedure

* added enum in constants

* update

* update

* update utils
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants