fix(routes): align whatsapp call ids
This commit is contained in:
@@ -186,8 +186,8 @@ func (h *AgentCapacityHandler) CreateInboxLimit(c *gin.Context) {
|
||||
response.AbortWithStatusError(c, http.StatusUnauthorized, response.ErrUnauthorized, "account not identified")
|
||||
return
|
||||
}
|
||||
policyID, err := parseUintParam(c, "id")
|
||||
if err != nil {
|
||||
policyID, err := parseUintAnyParam(c, "agent_capacity_policy_id", "id")
|
||||
if err != nil || policyID == 0 {
|
||||
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrBadRequest, "invalid id")
|
||||
return
|
||||
}
|
||||
@@ -217,13 +217,13 @@ func (h *AgentCapacityHandler) UpdateInboxLimit(c *gin.Context) {
|
||||
response.AbortWithStatusError(c, http.StatusUnauthorized, response.ErrUnauthorized, "account not identified")
|
||||
return
|
||||
}
|
||||
policyID, err := parseUintParam(c, "id")
|
||||
if err != nil {
|
||||
policyID, err := parseUintAnyParam(c, "agent_capacity_policy_id", "id")
|
||||
if err != nil || policyID == 0 {
|
||||
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrBadRequest, "invalid id")
|
||||
return
|
||||
}
|
||||
limitID, err := parseUintParam(c, "limit_id")
|
||||
if err != nil {
|
||||
limitID, err := parseUintAnyParam(c, "limit_id", "id")
|
||||
if err != nil || limitID == 0 {
|
||||
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrBadRequest, "invalid limit id")
|
||||
return
|
||||
}
|
||||
@@ -253,13 +253,13 @@ func (h *AgentCapacityHandler) DeleteInboxLimit(c *gin.Context) {
|
||||
response.AbortWithStatusError(c, http.StatusUnauthorized, response.ErrUnauthorized, "account not identified")
|
||||
return
|
||||
}
|
||||
policyID, err := parseUintParam(c, "id")
|
||||
if err != nil {
|
||||
policyID, err := parseUintAnyParam(c, "agent_capacity_policy_id", "id")
|
||||
if err != nil || policyID == 0 {
|
||||
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrBadRequest, "invalid id")
|
||||
return
|
||||
}
|
||||
limitID, err := parseUintParam(c, "limit_id")
|
||||
if err != nil {
|
||||
limitID, err := parseUintAnyParam(c, "limit_id", "id")
|
||||
if err != nil || limitID == 0 {
|
||||
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrBadRequest, "invalid limit id")
|
||||
return
|
||||
}
|
||||
@@ -283,8 +283,8 @@ func (h *AgentCapacityHandler) ListUsers(c *gin.Context) {
|
||||
response.AbortWithStatusError(c, http.StatusUnauthorized, response.ErrUnauthorized, "account not identified")
|
||||
return
|
||||
}
|
||||
policyID, err := parseUintParam(c, "id")
|
||||
if err != nil {
|
||||
policyID, err := parseUintAnyParam(c, "agent_capacity_policy_id", "id")
|
||||
if err != nil || policyID == 0 {
|
||||
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrBadRequest, "invalid id")
|
||||
return
|
||||
}
|
||||
@@ -306,8 +306,8 @@ func (h *AgentCapacityHandler) CreateUser(c *gin.Context) {
|
||||
response.AbortWithStatusError(c, http.StatusUnauthorized, response.ErrUnauthorized, "account not identified")
|
||||
return
|
||||
}
|
||||
policyID, err := parseUintParam(c, "id")
|
||||
if err != nil {
|
||||
policyID, err := parseUintAnyParam(c, "agent_capacity_policy_id", "id")
|
||||
if err != nil || policyID == 0 {
|
||||
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrBadRequest, "invalid id")
|
||||
return
|
||||
}
|
||||
@@ -340,13 +340,13 @@ func (h *AgentCapacityHandler) DeleteUser(c *gin.Context) {
|
||||
response.AbortWithStatusError(c, http.StatusUnauthorized, response.ErrUnauthorized, "account not identified")
|
||||
return
|
||||
}
|
||||
policyID, err := parseUintParam(c, "id")
|
||||
if err != nil {
|
||||
policyID, err := parseUintAnyParam(c, "agent_capacity_policy_id", "id")
|
||||
if err != nil || policyID == 0 {
|
||||
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrBadRequest, "invalid id")
|
||||
return
|
||||
}
|
||||
userID, err := parseUintParam(c, "user_id")
|
||||
if err != nil {
|
||||
userID, err := parseUintAnyParam(c, "user_id", "id")
|
||||
if err != nil || userID == 0 {
|
||||
response.AbortWithStatusError(c, http.StatusBadRequest, response.ErrBadRequest, "invalid user id")
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user