Merge branch '11-add-api-for-getting-home-page-data' into 22-integrate-api-and-frontend

This commit is contained in:
Erik Foris 2024-07-05 12:38:56 +02:00
commit c55c18c746
6 changed files with 4 additions and 15 deletions

View File

@ -1,12 +0,0 @@
package de.uni_passau.fim.PADAS.group3.DataDash.controler;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class PageController {
@GetMapping("/add")
public String getAddPage() {
return "add";
}
}

View File

@ -50,7 +50,7 @@ public class Dataset {
@ManyToOne
private Category categorie;
public Dataset(String title, String abst, String description, String author, URL url, Category categories, Type type) {
public Dataset(String title, String abst, String description, String author, URL url, Category categories, Type type, String licence) {
this.raiting = 0;
this.votes = 0;
@ -63,6 +63,7 @@ public class Dataset {
setCategorie(categories);
setType(type);
setUrl(url);
setLicence(licence);
}
public Dataset() {

View File

@ -25,7 +25,7 @@ public class LoadDummyDatabase {
Category category = new Category("Category" + i);
log.info("Preloading" + categoryRepository.save(category));
Dataset dataset = new Dataset("Title" + i, "Abst" + i, "Description" + i, "Author" + i,null, category, Type.API);
Dataset dataset = new Dataset("Title" + i, "Abst" + i, "Description" + i, "Author" + i,null, category, Type.API, "MIT");
for (int j = 0; j < new Random().nextInt(50); j++) {
dataset.upvote();
}

View File

@ -91,7 +91,7 @@ for (const downvoteButton of downvoteButtons) {
// functions of the main page
function navigateToAdd() {
window.location.href = "/add"; //TODO: move to EventListner?
window.location.href = "/add.html"; //TODO: move to EventListener?
}
function getFilterQuery() {