Skip to content

Commit

Permalink
poprawki (#44)
Browse files Browse the repository at this point in the history
* poprawki

* path fix
  • Loading branch information
KLR2002 authored Jun 11, 2024
1 parent 4468de2 commit 4efb7c7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void patchDuel(@RequestBody Map<String, String> fields, @PathVariable Lon

@GetMapping("/duels/curr")
public Duels getCurrentDuels() {
fightService.tryReload();
//fightService.tryReload();
return new Duels(
fightService.getCurrFights().map(Fight::toJson).toList()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public ReportController(ReportService reportService) {
this.reportService = reportService;
}

// @GetMapping("/report")
// public void getReport(@RequestParam String saveTo) throws DocumentException, FileNotFoundException {
// reportService.generate(saveTo);
// }
@GetMapping("/report")
public void getReport(@RequestParam String saveTo) throws DocumentException, FileNotFoundException {
reportService.generate(saveTo);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ private void addFightWeightClassSection(WeightClass weightClass) throws Document
var f2 = fight.secondUser();

addTableColumns(table, List.of(
new Column(String.format("%s %s", f1.name(), f1.surname()), fighterColor.apply(f1)),
new Column(String.format("%s %s", f2.name(), f2.surname()), fighterColor.apply(f2)),
f1 != null ? new Column(String.format("%s %s", f1.name(), f1.surname()), fighterColor.apply(f1)) : text(""),
f2 != null ? new Column(String.format("%s %s", f2.name(), f2.surname()), fighterColor.apply(f2)) : text(""),
text(String.valueOf(fight.number())),
text(String.format("%s:%s", fight.score1(), fight.score2()))
));
Expand Down
21 changes: 11 additions & 10 deletions frontend/src/components/ChangeCategoryForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import exitIcon from '../../assets/icons/exit.png';
import config from '../config.js'

function ChangeCategoryForm() {
const [newWeightCategory, setNewWeightCategory] = useState("Light-weight - M");
const [newWeightCategory, setNewWeightCategory] = useState("Men Heavy-weight");
const { id } = useParams();
const {
isLoading: isPending,
Expand All @@ -19,7 +19,8 @@ function ChangeCategoryForm() {

const handleSubmit = (e) => {
e.preventDefault();
patchData({ weightCategory: newWeightCategory });
console.log(newWeightCategory);
patchData({ weightClass: newWeightCategory });
history(`/contestants/${id}`);
};

Expand All @@ -46,14 +47,14 @@ function ChangeCategoryForm() {
required
onChange={(e) => setNewWeightCategory(e.target.value)}
>
<option value="Men Heavy-weight">Light-weight</option>
<option value="Men Middle-weight">Middle-weight</option>
<option value="Jr. Men Heavy-weight">Middle-weight</option>
<option value="Jr. Men Middle-weight">Middle-weight</option>
<option value="Women Heavy-weight">Light-weight</option>
<option value="Women Middle-weight">Middle-weight</option>
<option value="Jr. Women Heavy-weight">Middle-weight</option>
<option value="Jr. Women Middle-weight">Middle-weight</option>
<option value="Men Heavy-weight">Men Heavy-weight</option>
<option value="Men Middle-weight">Men Middle-weight</option>
<option value="Jr. Men Heavy-weight">Jr. Men Heavy-weight</option>
<option value="Jr. Men Middle-weight">Jr. Men Middle-weight</option>
<option value="Women Heavy-weight">Women Heavy-weight</option>
<option value="Women Middle-weight">Women Middle-weight</option>
<option value="Jr. Women Heavy-weight">Jr. Women Heavy-weight</option>
<option value="Jr. Women Middle-weight">Jr. Women Middle-weight</option>
</select>
<br/>
{!isPending && <button type="submit">Update Category</button>}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/MainView.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function MainView() {
try {
console.log(filePath);
const response = await fetch(
`${config.backendUrl}/report?saveTo=/D:/raport.pdf`,
`${config.backendUrl}/report?saveTo=raport.pdf`,
{
method: 'GET',
},
Expand Down

0 comments on commit 4efb7c7

Please sign in to comment.