Add link from root upload page to upload pool detail page.

This commit is contained in:
Eli Ribble 2026-02-24 20:02:44 +00:00
parent a776c83557
commit c8f5408f27
No known key found for this signature in database
8 changed files with 20 additions and 85 deletions

View file

@ -74,8 +74,7 @@ func Router() chi.Router {
r.Method("GET", "/trap/{globalid}", authenticatedHandler(getTrap))
r.Method("GET", "/text/{destination}", authenticatedHandler(getTextMessages))
r.Method("GET", "/upload", authenticatedHandler(getUploadList))
r.Method("GET", "/upload/pool", authenticatedHandler(getUploadPoolList))
r.Method("GET", "/upload/pool/create", authenticatedHandler(getUploadPoolCreate))
r.Method("GET", "/upload/pool", authenticatedHandler(getUploadPoolCreate))
r.Method("POST", "/upload/pool/create", authenticatedHandlerPostMultipart(postUploadPoolCreate))
r.Method("GET", "/upload/{id}", authenticatedHandler(getUploadByID))
r.Method("POST", "/upload/{id}/discard", authenticatedHandlerPost(postUploadDiscard))

View file

@ -47,20 +47,9 @@ type contentUploadPoolList struct {
}
type contentUploadPoolCreate struct{}
func getUploadPoolList(ctx context.Context, r *http.Request, org *models.Organization, u *models.User) (*response[contentUploadPoolList], *errorWithStatus) {
uploads, err := platform.PoolUploadList(ctx, u.OrganizationID)
if err != nil {
return nil, newError("Failed to get uploads: %w", err)
}
data := contentUploadPoolList{
Uploads: uploads,
}
return newResponse("sync/pool-list.html", data), nil
}
func getUploadPoolCreate(ctx context.Context, r *http.Request, org *models.Organization, u *models.User) (*response[contentUploadPoolCreate], *errorWithStatus) {
data := contentUploadPoolCreate{}
return newResponse("sync/pool-csv-upload.html", data), nil
return newResponse("sync/upload-csv-pool.html", data), nil
}
func getUploadByID(ctx context.Context, r *http.Request, org *models.Organization, u *models.User) (*response[contentUploadDetail], *errorWithStatus) {
file_id_str := chi.URLParam(r, "id")

View file

@ -6,7 +6,6 @@ import (
type ContentURL struct {
OAuthRefreshArcGIS string
PoolCSVUpload string
Root string
Route string
SamplePoolCSV string
@ -18,12 +17,12 @@ type ContentURL struct {
SettingUser string
SettingUserAdd string
Tegola string
UploadCSVPool string
}
func newContentURL() ContentURL {
return ContentURL{
OAuthRefreshArcGIS: config.MakeURLNidus("/arcgis/oauth/begin"),
PoolCSVUpload: config.MakeURLNidus("/pool/upload"),
Root: config.MakeURLNidus("/"),
Route: config.MakeURLNidus("/route"),
SamplePoolCSV: config.MakeURLNidus("/static/file/sample-pool.csv"),
@ -35,5 +34,6 @@ func newContentURL() ContentURL {
SettingUser: config.MakeURLNidus("/setting/user"),
SettingUserAdd: config.MakeURLNidus("/setting/user/add"),
Tegola: config.MakeURLTegola("/"),
UploadCSVPool: config.MakeURLNidus("/upload/pool"),
}
}