fix_change_user_name #104
Binary file not shown.
|
@ -48,7 +48,7 @@ public class UpdateUserSettingsAction {
|
|||
|
||||
public UpdateResult updateShippingInfo(String salutation, String name, String address) {
|
||||
this.user.salutation = salutation;
|
||||
this.user.name = name;
|
||||
this.user.defaultDeliveryAddress.name = name;
|
||||
this.user.defaultDeliveryAddress.addressString = address;
|
||||
this.repository.save(this.user);
|
||||
return new UpdateResult(true);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.hso.ecommerce.components;
|
||||
|
||||
import org.hso.ecommerce.entities.booking.PaymentMethod;
|
||||
import org.hso.ecommerce.entities.shop.Address;
|
||||
import org.hso.ecommerce.entities.user.User;
|
||||
import org.hso.ecommerce.repos.user.UserRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -23,7 +24,8 @@ public class AdminInitializer {
|
|||
// create first admin user
|
||||
User firstAdmin = new User();
|
||||
firstAdmin.created = new Timestamp(System.currentTimeMillis());
|
||||
firstAdmin.name = "admin";
|
||||
firstAdmin.defaultDeliveryAddress = new Address();
|
||||
firstAdmin.defaultDeliveryAddress.name = "admin";
|
||||
firstAdmin.defaultPayment = new PaymentMethod();
|
||||
firstAdmin.defaultPayment.creditCardNumber = ""; //set empty number
|
||||
firstAdmin.email = "admin";
|
||||
|
|
|
@ -23,10 +23,10 @@ public class User {
|
|||
@NotNull
|
||||
@Column(unique = true)
|
||||
public String email;
|
||||
|
||||
/*
|
||||
@Column(insertable = false, updatable = false)
|
||||
public String name;
|
||||
|
||||
*/
|
||||
public String salutation;
|
||||
|
||||
public String passwordHash;
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td th:text="${user.name}"></td>
|
||||
<td th:text="${user.defaultDeliveryAddress.name}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>E-Mail</th>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<tr th:each="user: ${users}">
|
||||
<td th:text="${user.id}"></td>
|
||||
<td th:text="${user.created.toString().substring(0, 10)}"></td>
|
||||
<td th:text="${user.name}"></td>
|
||||
<td th:text="${user.defaultDeliveryAddress.name}"></td>
|
||||
<td th:text="${user.email}"></td>
|
||||
<td>
|
||||
<span th:text="${user.isActive} ? 'Aktiv,' : 'Inaktiv,'"></span>
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
</div>
|
||||
<div>
|
||||
<label for="name">Name</label>
|
||||
<input class="full-width" type="text" name="name" id="name" placeholder="Nachname Vorname" th:value="${user.name}"
|
||||
<input class="full-width" type="text" name="name" id="name" placeholder="Nachname Vorname" th:value="${user.defaultDeliveryAddress.name}"
|
||||
required/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Reference in New Issue