INFRA-2894 | handled justification text's max length in update incident API (#368)
This commit is contained in:
@@ -563,7 +563,7 @@ func (i *incidentService) UpdateIncident(c *gin.Context) {
|
||||
|
||||
err := utils.ValidateUpdateIncidentRequest(updateIncidentRequest, userEmail)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, common.ErrorResponse(err, http.StatusBadRequest, nil))
|
||||
c.JSON(http.StatusBadRequest, common.ErrorResponse(err, http.StatusBadRequest, nil))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,9 @@ func ValidateUpdateIncidentRequest(request service.UpdateIncidentRequest, userEm
|
||||
if request.MetaData != emptyMetaData && (request.MetaData.CustomerId == uuid.Nil || request.MetaData.PhoneNumber == "" || request.MetaData.CrmTicketCreationTime == nil || request.MetaData.TicketId == "" || request.MetaData.TicketGroup == "" || request.MetaData.AgentName == "") {
|
||||
return errors.New("metadata should contain customer id, phone number and crm ticket creation time")
|
||||
}
|
||||
if len(request.Justification) > 100 {
|
||||
return errors.New("justification should not be more than 100 characters long")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user