This commit is contained in:
_Bastler 2021-10-27 17:27:00 +02:00
parent f92b300c1c
commit 2af3b8cd63

View File

@ -7,8 +7,6 @@ import java.time.Instant;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@ -84,7 +82,6 @@ public class InviteController extends BaseController {
* @return the invite * @return the invite
*/ */
@GetMapping("/{code}") @GetMapping("/{code}")
@Transactional
public Invite get(@PathVariable("code") String code) { public Invite get(@PathVariable("code") String code) {
Invite invite = inviteManager.getByCode(code); Invite invite = inviteManager.getByCode(code);
if (invite == null) { if (invite == null) {
@ -92,12 +89,10 @@ public class InviteController extends BaseController {
} }
if (getCurrentUserId() == null) { if (getCurrentUserId() == null) {
invite.setId(null);
invite.setItem(null); invite.setItem(null);
invite.setNote(null); invite.setNote(null);
invite.setOwner(null); invite.setOwner(null);
} else if (!getCurrentUserId().equals(invite.getOwner())) { } else if (!getCurrentUserId().equals(invite.getOwner())) {
invite.setId(null);
invite.setCode(null); invite.setCode(null);
invite.setCodeLink(null); invite.setCodeLink(null);
invite.setOwner(null); invite.setOwner(null);
@ -272,7 +267,6 @@ public class InviteController extends BaseController {
pageParameter.orElse(0), sizeParameter.orElse(10), searchParameter.orElse(null), pageParameter.orElse(0), sizeParameter.orElse(10), searchParameter.orElse(null),
redeemedParameter.orElse(null)); redeemedParameter.orElse(null));
for (Invite invite : page.getContent()) { for (Invite invite : page.getContent()) {
invite.setId(null);
invite.setCode(null); invite.setCode(null);
invite.setCodeLink(null); invite.setCodeLink(null);
invite.setMessage(null); invite.setMessage(null);