diff --git a/resq/backend/resq/src/main/java/com/groupa1/resq/converter/NeedConverter.java b/resq/backend/resq/src/main/java/com/groupa1/resq/converter/NeedConverter.java index 8f9b4ddd..323007ca 100644 --- a/resq/backend/resq/src/main/java/com/groupa1/resq/converter/NeedConverter.java +++ b/resq/backend/resq/src/main/java/com/groupa1/resq/converter/NeedConverter.java @@ -31,7 +31,8 @@ public NeedDto convertToDto(Need need) { needDto.setLatitude(need.getLatitude()); needDto.setLongitude(need.getLongitude()); needDto.setCreatedDate(need.getCreatedAt()); - needDto.setSize(need.getSize()); + if (need.getSize() != null) + needDto.setSize(need.getSize()); Request request = need.getRequest(); if (request != null) { needDto.setRequestId(request.getId()); @@ -52,11 +53,11 @@ public Need convertToEntity(NeedDto needDto) { need.setLongitude(needDto.getLongitude()); need.setStatus(needDto.getStatus()); need.setCreatedAt(needDto.getCreatedDate()); - need.setSize(needDto.getSize()); + if (needDto.getSize() != null) + need.setSize(needDto.getSize()); Request request = requestRepository.findById(needDto.getRequestId()).orElse(null); need.setRequest(request); return need; } - } diff --git a/resq/backend/resq/src/main/java/com/groupa1/resq/converter/ResourceConverter.java b/resq/backend/resq/src/main/java/com/groupa1/resq/converter/ResourceConverter.java index 966cb069..0a92c38e 100644 --- a/resq/backend/resq/src/main/java/com/groupa1/resq/converter/ResourceConverter.java +++ b/resq/backend/resq/src/main/java/com/groupa1/resq/converter/ResourceConverter.java @@ -27,7 +27,8 @@ public ResourceDto convertToDto(Resource resource){ resourceDto.setLatitude(resource.getLatitude()); resourceDto.setLongitude(resource.getLongitude()); resourceDto.setCreatedDate(resource.getCreatedAt()); - resourceDto.setSize(resource.getSize().toString()); + if (resource.getSize() != null) + resourceDto.setSize(resource.getSize().toString()); return resourceDto; } @@ -49,7 +50,8 @@ public Resource convertToEntity(ResourceDto resourceDto){ resource.setLatitude(resourceDto.getLatitude()); resource.setLongitude(resourceDto.getLongitude()); resource.setCreatedAt(resourceDto.getCreatedDate()); - resource.setSize(ESize.valueOf(resourceDto.getSize())); + if (resourceDto.getSize() != null) + resource.setSize(ESize.valueOf(resourceDto.getSize())); return resource; } } diff --git a/resq/backend/resq/src/main/java/com/groupa1/resq/entity/enums/EGender.java b/resq/backend/resq/src/main/java/com/groupa1/resq/entity/enums/EGender.java index 8e41e575..5386ae75 100644 --- a/resq/backend/resq/src/main/java/com/groupa1/resq/entity/enums/EGender.java +++ b/resq/backend/resq/src/main/java/com/groupa1/resq/entity/enums/EGender.java @@ -1,8 +1,8 @@ package com.groupa1.resq.entity.enums; public enum EGender { - MAN, - WOMAN, + MALE, + FEMALE, CHILDREN_BOY, CHILDREN_GIRL, BABY }