fix: 优化工作人员重复信息提示
This commit is contained in:
@@ -104,7 +104,7 @@ func CreateStaff(ctx *gin.Context) {
|
||||
infra.Response.Error(ctx, errcode.ErrInvalidArgument)
|
||||
return
|
||||
}
|
||||
if err := impl.DBService.Create(&staff).Error; err != nil {
|
||||
if err := common.CreateStaffRecord(&staff); err != nil {
|
||||
infra.Response.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
@@ -145,7 +145,7 @@ func UpdateStaff(ctx *gin.Context) {
|
||||
if request.Avatar != nil {
|
||||
values["avatar"] = *request.Avatar
|
||||
}
|
||||
common.UpdateAllowedByIdentity(ctx, &models.StaffAccount{}, values, []string{"name", "phone", "avatar", "role_code", "gas_basic_id", "delivery_basic_id", "work_status"})
|
||||
common.UpdateAllowedByIdentityWithError(ctx, &models.StaffAccount{}, values, []string{"name", "phone", "avatar", "role_code", "gas_basic_id", "delivery_basic_id", "work_status"}, common.StaffWriteError)
|
||||
}
|
||||
|
||||
func validWorkStatus(status string) bool { return status == "on_duty" || status == "off_duty" }
|
||||
|
||||
Reference in New Issue
Block a user