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