Fakultas Ilmu Komputer UI

Commit 39cfa4f8 authored by WINALDO AMADEA HESTU's avatar WINALDO AMADEA HESTU
Browse files

Merge branch 'winaldo' into 'staging'

fix null bug

See merge request !29
parents 65454c75 9f17fa81
Pipeline #134480 passed with stages
in 24 minutes and 32 seconds
......@@ -39,10 +39,16 @@ public class PaymentController {
@GetMapping(path="/payment-methods")
public String paymentList(Model model, Principal principal){
String user;
if (principal != null) {
user = principal.getName();
} else {
user = "";
}
paymentService.getUserPayments();
model.addAttribute("username", (principal != null) ? principal.getName() : "");
model.addAttribute("username",user);
model.addAttribute("payments", paymentService.getUserPayments());
model.addAttribute("user", userService.getUserByName(principal.getName()));
model.addAttribute("user", userService.getUserByName(user));
return "payment-methods";
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment