@@ -86,14 +86,14 @@ public class ComplaintEntityHandler implements RequestHandler {
|
|||||||
"violation_id is required");
|
"violation_id is required");
|
||||||
if (req.getComplaintText() == null) return errorResponse(msgId, MessageCode.NOT_FOUND.getCode(),
|
if (req.getComplaintText() == null) return errorResponse(msgId, MessageCode.NOT_FOUND.getCode(),
|
||||||
"text is required");
|
"text is required");
|
||||||
|
//
|
||||||
ComplaintEntity complaintEntity = complaintEntityRepository.findById(req.getId()).orElse(null);
|
// ComplaintEntity complaintEntity = complaintEntityRepository.findById(req.getId()).orElse(null);
|
||||||
|
//
|
||||||
if (complaintEntity == null || !Objects.equals(
|
// if (complaintEntity == null || !Objects.equals(
|
||||||
complaintEntity.getViolation().getFileEntity().getUserId(), userId)) {
|
// complaintEntity.getViolation().getFileEntity().getUserId(), userId)) {
|
||||||
return errorResponse(msgId, MessageCode.USER_NOT_HAD_PERMISSION.getCode(),
|
// return errorResponse(msgId, MessageCode.USER_NOT_HAD_PERMISSION.getCode(),
|
||||||
MessageCode.USER_NOT_HAD_PERMISSION.getDescription());
|
// MessageCode.USER_NOT_HAD_PERMISSION.getDescription());
|
||||||
}
|
// }
|
||||||
|
|
||||||
ComplaintResponse response = complaintService.createComplaint(req);
|
ComplaintResponse response = complaintService.createComplaint(req);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user