fix: 优化工作人员重复信息提示
This commit is contained in:
@@ -71,7 +71,7 @@ func CreateStaff(ctx *gin.Context) {
|
||||
Name: request.Name, Phone: request.Phone, Avatar: request.Avatar, RoleCode: "delivery",
|
||||
GasBasicID: point.GasBasicID, DeliveryBasicID: point.ID, WorkStatus: request.WorkStatus,
|
||||
}
|
||||
if err := db().Create(&staff).Error; err != nil {
|
||||
if err := common.CreateStaffRecord(&staff); err != nil {
|
||||
infra.Response.Error(ctx, err)
|
||||
return
|
||||
}
|
||||
@@ -92,9 +92,9 @@ func UpdateStaff(ctx *gin.Context) {
|
||||
infra.Response.Error(ctx, errcode.ErrInvalidArgument)
|
||||
return
|
||||
}
|
||||
common.UpdateAllowedByIdentity(ctx, &models.StaffAccount{}, gin.H{
|
||||
common.UpdateAllowedByIdentityWithError(ctx, &models.StaffAccount{}, gin.H{
|
||||
"name": request.Name, "phone": request.Phone, "avatar": request.Avatar, "work_status": request.WorkStatus,
|
||||
}, []string{"name", "phone", "avatar", "work_status"})
|
||||
}, []string{"name", "phone", "avatar", "work_status"}, common.StaffWriteError)
|
||||
}
|
||||
|
||||
func ResetStaffPassword(ctx *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user