[Frontend] Introduce Update Admin Functionality
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
updatebutton. Note that image should also be changable. - [ ] Once admin, fill the required info and click on
updatebutton, the updateAdmin api should get called. - [ ] Make sure to add the required form validations
please assign me this issue as GGsoc 24
How will i pass _id ? I think it not stored nor getAdmins api send it ?
if getAdmins api send _id . it can be passed down as props. should i change getAdmins api ---
@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 ?
Is this ok i changed name and email as they were not defined to be updated in updateAdminValidation schema
@SwayamRana808 yes, the ui looks fine, i hope i will see the pre-populated data once i click on edit icon
I have added edit-icon on the profile image but it doesn't do anything. should i keep it ?
The edit icon is redundant on image, u can remove it but admin should be able to change their profile image(in edit mode)
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 ?
yes @SwayamRana808 please add it and refer teamMember api, which is using multer to store the images
have updated the level to level 3 of the issue as this is an extra work that i didn't forsee