fix: custom indicator exist issue
This commit is contained in:
@@ -174,7 +174,7 @@ func (k *KpiCTitle) Post(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
userName := ctx.LoginUserToUserName(c)
|
userName := ctx.LoginUserToUserName(c)
|
||||||
title.CreatedBy = &userName
|
title.CreatedBy = &userName
|
||||||
result := dborm.DefaultDB().Where("ne_type=? and (kpi_id=? or title=?)", title.NeType, title.KpiID, title.Title).First(&title)
|
result := dborm.DefaultDB().Where("ne_type=? and (kpi_id=? or title=?) and stauts!='Deleted'", title.NeType, title.KpiID, title.Title).First(&title)
|
||||||
if result.RowsAffected > 0 {
|
if result.RowsAffected > 0 {
|
||||||
c.JSON(http.StatusOK, services.ErrResp("custom indicator already exist"))
|
c.JSON(http.StatusOK, services.ErrResp("custom indicator already exist"))
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user