From e06938bdad19a01c7273524f93365c1eba5481cb Mon Sep 17 00:00:00 2001
From: heikkkk <henrik.teksle.sandok@hotmail.no>
Date: Fri, 3 May 2024 12:31:03 +0200
Subject: [PATCH] feat: add banner image to user update

---
 .../idi/stud/savingsapp/controller/user/UserController.java   | 3 +++
 .../no/ntnu/idi/stud/savingsapp/dto/user/UserUpdateDTO.java   | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/main/java/no/ntnu/idi/stud/savingsapp/controller/user/UserController.java b/src/main/java/no/ntnu/idi/stud/savingsapp/controller/user/UserController.java
index add2356..24a0aaf 100644
--- a/src/main/java/no/ntnu/idi/stud/savingsapp/controller/user/UserController.java
+++ b/src/main/java/no/ntnu/idi/stud/savingsapp/controller/user/UserController.java
@@ -126,6 +126,9 @@ public class UserController {
     if (updateDTO.getProfileImage() != null) {
       user.setProfileImage(updateDTO.getProfileImage());
     }
+    if(updateDTO.getBannerImage() != null) {
+      user.setBannerImage(updateDTO.getBannerImage());
+    }
     if (updateDTO.getConfiguration() != null) {
       if (updateDTO.getConfiguration().getCommitment() != null) {
         user.getConfiguration().setCommitment(Commitment.valueOf(updateDTO.getConfiguration().getCommitment()));
diff --git a/src/main/java/no/ntnu/idi/stud/savingsapp/dto/user/UserUpdateDTO.java b/src/main/java/no/ntnu/idi/stud/savingsapp/dto/user/UserUpdateDTO.java
index d4ca79f..ead9c55 100644
--- a/src/main/java/no/ntnu/idi/stud/savingsapp/dto/user/UserUpdateDTO.java
+++ b/src/main/java/no/ntnu/idi/stud/savingsapp/dto/user/UserUpdateDTO.java
@@ -2,11 +2,9 @@ package no.ntnu.idi.stud.savingsapp.dto.user;
 
 import jakarta.validation.Valid;
 import jakarta.validation.constraints.Email;
-import jakarta.validation.constraints.NotNull;
 import lombok.Data;
 import no.ntnu.idi.stud.savingsapp.dto.configuration.ConfigurationDTO;
 import no.ntnu.idi.stud.savingsapp.validation.Name;
-import no.ntnu.idi.stud.savingsapp.validation.Password;
 
 @Data
 public final class UserUpdateDTO {
@@ -22,6 +20,8 @@ public final class UserUpdateDTO {
 
   private Long profileImage;
 
+  private Long bannerImage;
+
   @Valid
   private ConfigurationDTO configuration;
 }
-- 
GitLab