Skip to content

Commit e6433d5

Browse files
committed
fix: fix endpoint paths
1 parent 91ac086 commit e6433d5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pages/fileExplorer/ExploreAt.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ import (
1919
var fileExplorerTemplate = template.Must(template.ParseFiles("pages/fileExplorer/fileExplorerPartial.gohtml"))
2020

2121
type FilesData struct {
22-
Items []SongItem
22+
Items []FileItem
2323
Path string
2424
ResultMessage string
2525
}
2626

27-
type SongItem struct {
27+
type FileItem struct {
2828
IsDir bool
2929
IsSong bool
3030
IsGoUp bool
@@ -79,15 +79,15 @@ func renderExplorer(w reqRes.MyResponseWriter, fileSystemFolder string, queryFol
7979
}
8080

8181
var templatePageData = FilesData{
82-
Items: make([]SongItem, len(dirEntries)),
82+
Items: make([]FileItem, len(dirEntries)),
8383
Path: queryFolder,
8484
ResultMessage: resultMessage,
8585
}
8686

8787
for index, file := range dirEntries {
8888
isDir := file.IsDir()
8989
fileName := file.Name()
90-
templatePageData.Items[index] = SongItem{
90+
templatePageData.Items[index] = FileItem{
9191
IsDir: isDir,
9292
IsSong: !isDir && IsSong(fileName),
9393
Name: fileName,
@@ -96,7 +96,7 @@ func renderExplorer(w reqRes.MyResponseWriter, fileSystemFolder string, queryFol
9696
}
9797
}
9898

99-
slices.SortFunc(templatePageData.Items, func(a, b SongItem) int {
99+
slices.SortFunc(templatePageData.Items, func(a, b FileItem) int {
100100
if a.IsDir {
101101
return -1
102102
}
@@ -108,7 +108,7 @@ func renderExplorer(w reqRes.MyResponseWriter, fileSystemFolder string, queryFol
108108

109109
canGoUp := queryFolder != ""
110110
if canGoUp {
111-
templatePageData.Items = slices.Insert(templatePageData.Items, 0, SongItem{
111+
templatePageData.Items = slices.Insert(templatePageData.Items, 0, FileItem{
112112
IsDir: true,
113113
IsSong: false,
114114
IsGoUp: true,

pages/fileExplorer/fileExplorerPartial.gohtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<section class="form-section">
5252
<h4>Create folder</h4>
5353
<form id="create-folder-form" hx-encoding="multipart/form-data"
54-
hx-put="/songFolder/{{.Path}}"
54+
hx-put="/directory/{{.Path}}"
5555
hx-target="#file-explorer">
5656

5757
<div class="form-control">
@@ -72,7 +72,7 @@
7272
<hr/>
7373
<section class="form-section">
7474
<h4>Upload file</h4>
75-
<form id="file-upload-form" hx-encoding="multipart/form-data" hx-put="/song/{{.Path}}"
75+
<form id="file-upload-form" hx-encoding="multipart/form-data" hx-put="/file/{{.Path}}"
7676
hx-target="#file-explorer">
7777
<input id="file-input" type="file" name="file" class="primary-button">
7878
<div class="form-submit-block">

0 commit comments

Comments
 (0)