fix: change username to name and add profile pic to staff
This commit is contained in:
@@ -17,9 +17,10 @@ type LoginRepoResponse struct {
|
||||
}
|
||||
|
||||
type StaffProfile struct {
|
||||
ID string `json:"id"`
|
||||
Email string `json:"email"`
|
||||
Username string `json:"username"`
|
||||
ID string `json:"id"`
|
||||
Email string `json:"email"`
|
||||
Name string `json:"name"`
|
||||
ProfilePicture string `json:"profile_picture"`
|
||||
}
|
||||
|
||||
type UserProfile struct {
|
||||
|
||||
@@ -16,20 +16,22 @@ type User struct {
|
||||
}
|
||||
|
||||
type RegisterStaffReq struct {
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
Username string `json:"username" validate:"required"`
|
||||
Email string `json:"email" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
Name string `json:"name" validate:"required"`
|
||||
ProfilePicture string `json:"profile_picture"`
|
||||
}
|
||||
|
||||
type UpdateStaffReq struct {
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
Username string `json:"username"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type Staff struct {
|
||||
ID string `json:"id"`
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
Username string `json:"username"`
|
||||
ID string `json:"id"`
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password"`
|
||||
Name string `json:"name"`
|
||||
ProfilePicture string `json:"profile_picture"`
|
||||
}
|
||||
|
||||
@@ -9,9 +9,10 @@ func (as *AuthSvc) GetStaffProfile(email string) (*authdomain.StaffProfile, erro
|
||||
}
|
||||
|
||||
profile := &authdomain.StaffProfile{
|
||||
ID: staff.ID,
|
||||
Username: staff.Username,
|
||||
Email: staff.Email,
|
||||
ID: staff.ID,
|
||||
Name: staff.Name,
|
||||
Email: staff.Email,
|
||||
ProfilePicture: staff.ProfilePicture,
|
||||
}
|
||||
|
||||
return profile, nil
|
||||
|
||||
@@ -20,10 +20,11 @@ func (a *AuthSvc) RegisterStaff(spec authdomain.RegisterStaffReq) (string, error
|
||||
}
|
||||
|
||||
staff := authdomain.Staff{
|
||||
ID: uuid.NewString(),
|
||||
Email: spec.Email,
|
||||
Password: hashedPwd,
|
||||
Username: spec.Username,
|
||||
ID: uuid.NewString(),
|
||||
Email: spec.Email,
|
||||
Password: hashedPwd,
|
||||
Name: spec.Name,
|
||||
ProfilePicture: spec.ProfilePicture,
|
||||
}
|
||||
|
||||
_, err = a.staffRepo.Create(&staff)
|
||||
|
||||
Reference in New Issue
Block a user