25 lines
468 B
Go
Raw Normal View History

2025-03-14 12:41:11 +08:00
package staffsvc
import (
staffdomain "legalgo-BE-go/internal/domain/staff"
)
func (as *impl) Update(id string, spec staffdomain.StaffUpdate) error {
if _, err := as.staffRepo.GetStaffByID(id); err != nil {
return err
}
newSpec := staffdomain.Staff{
ID: id,
Email: spec.Email,
Name: spec.Name,
ProfilePicture: spec.ProfilePicture,
}
if err := as.staffRepo.Update(newSpec); err != nil {
return err
}
return nil
}