Community-Website icon indicating copy to clipboard operation
Community-Website copied to clipboard

[Frontend] Introduce Update Admin Functionality

Open Kajol-Kumari opened this issue 1 year ago • 11 comments

Description

Currently admins can't update their details from admin portal.

Expectation

  • [ ] Correct the Update admin UI, to show the pre-populated existing info along with an update button. Note that image should also be changable.
  • [ ] Once admin, fill the required info and click on update button, the updateAdmin api should get called.
  • [ ] Make sure to add the required form validations
Screenshot 2024-05-16 at 2 12 55 PM

Kajol-Kumari avatar May 16 '24 08:05 Kajol-Kumari

please assign me this issue as GGsoc 24

SwayamRana808 avatar May 16 '24 10:05 SwayamRana808

How will i pass _id ? I think it not stored nor getAdmins api send it ?

Screenshot 2024-05-17 231829

SwayamRana808 avatar May 17 '24 17:05 SwayamRana808

if getAdmins api send _id . it can be passed down as props. should i change getAdmins api ---

Screenshot 2024-05-17 233037

SwayamRana808 avatar May 17 '24 18:05 SwayamRana808

@SwayamRana808 yeah, it seems like we will have to have id in admin details and getAdmin should fetch that id as well, then only we would be able to make the update call, can u please raise an issue for the same ?

Kajol-Kumari avatar May 18 '24 05:05 Kajol-Kumari

Is this ok i changed name and email as they were not defined to be updated in updateAdminValidation schema

Screenshot 2024-05-18 152825

SwayamRana808 avatar May 18 '24 10:05 SwayamRana808

@SwayamRana808 yes, the ui looks fine, i hope i will see the pre-populated data once i click on edit icon

Kajol-Kumari avatar May 18 '24 11:05 Kajol-Kumari

I have added edit-icon on the profile image but it doesn't do anything. should i keep it ? Screenshot 2024-05-18 185047

SwayamRana808 avatar May 18 '24 13:05 SwayamRana808

The edit icon is redundant on image, u can remove it but admin should be able to change their profile image(in edit mode)

Kajol-Kumari avatar May 18 '24 14:05 Kajol-Kumari

there is no image schema path defined in Admin schema to store image path (:uploads/Admin) and no multer defined in Admin index.js to parse multiform/form data as i am using formData to send fields to update which can be used to update image ? Should i add that ?

SwayamRana808 avatar May 18 '24 16:05 SwayamRana808

yes @SwayamRana808 please add it and refer teamMember api, which is using multer to store the images

Kajol-Kumari avatar May 18 '24 16:05 Kajol-Kumari

have updated the level to level 3 of the issue as this is an extra work that i didn't forsee

Kajol-Kumari avatar May 18 '24 16:05 Kajol-Kumari