fixed category in posts
This commit is contained in:
@@ -5,6 +5,7 @@ import com.krylov.refound.dto.PostResponse;
|
||||
import com.krylov.refound.entity.Image;
|
||||
import com.krylov.refound.entity.Post;
|
||||
import com.krylov.refound.enums.ErrorCode;
|
||||
import com.krylov.refound.enums.PostCategory;
|
||||
import com.krylov.refound.enums.PostStatus;
|
||||
import com.krylov.refound.exception.ApiException;
|
||||
import com.krylov.refound.mapper.PostMapper;
|
||||
@@ -93,7 +94,9 @@ public class PostService {
|
||||
|
||||
post.setTitle(request.getTitle());
|
||||
post.setDescription(request.getDescription());
|
||||
post.setCategory(request.getCategory());
|
||||
if (request.getCategory() != null) {
|
||||
post.setCategory(PostCategory.fromDisplayName(request.getCategory()));
|
||||
}
|
||||
post.setPhone(request.getPhone());
|
||||
post.setType(request.getType());
|
||||
if (request.getLatitude() != null && request.getLongitude() != null){
|
||||
|
||||
Reference in New Issue
Block a user