Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,3 @@ Om appen inte kan nå databasen:
- kontrollera att port `5432` inte redan används av en annan lokal PostgreSQL-instans
- kontrollera att dina `DB_*`-miljövariabler matchar värdena i Compose-konfigurationen
- starta om databasen med `docker compose down` följt av `docker compose up -d`


$ docker run -p 9000:9000 -p 9001:9001 \
-e MINIO_ROOT_USER=minioadmin \
-e MINIO_ROOT_PASSWORD=minioadmin \
minio/minio server /data --console-address ":9001"
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,8 @@ public String uploadDocument(
RedirectAttributes redirectAttributes
) {
try {
System.out.println("uploadDocument endpoint reached");
System.out.println("Principal: " + principal);
System.out.println("Ticket id: " + id);
System.out.println("File original name: " + file.getOriginalFilename());
System.out.println("File empty: " + file.isEmpty());
System.out.println("File size: " + file.getSize());

User user = userRepository.findByUsername(principal.getName())
.orElseThrow(() -> new ResourceNotFoundException("User not found with username: " + principal.getName()));
.orElseThrow(() -> new ResourceNotFoundException("User not found with username: " + principal.getName()));

documentService.uploadDocument(id, user.getId(), file);
redirectAttributes.addFlashAttribute("documentSuccess", "Dokumentet laddades upp.");
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/documents/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<h2>Alla uppladdade filer i systemet.</h2>
<p class="lead">
En global översikt över dokument metadata. Nedladdning går via backend
och vi använder MiniIO.
och vi använder MinIO.
</p>
</section>

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/templates/tickets/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ <h3>Dokument</h3>
<span>Eller klicka för att välja fil</span>
<span>Du kan även klistra in en bild med Ctrl+V</span>
</div>
<input id="file" name="file" type="file" required data-document-file-input>
<p class="muted document-selection" id="document-upload-selection" data-document-selection>
Ingen fil vald ännu.
</p>
Expand Down