diff --git a/server/internal/api/exports.go b/server/internal/api/exports.go index 53916e1..ebf964a 100644 --- a/server/internal/api/exports.go +++ b/server/internal/api/exports.go @@ -342,10 +342,14 @@ func (a *ExportsAPI) create(w http.ResponseWriter, r *http.Request) { } } } - // owner from query userId if provided + // owner from query current_user_id or userId if provided owner := uint64(0) - if uidStr := r.URL.Query().Get("userId"); uidStr != "" { - first := strings.TrimSpace(strings.Split(uidStr, ",")[0]) + ownStr := r.URL.Query().Get("current_user_id") + if ownStr == "" { + ownStr = r.URL.Query().Get("userId") + } + if ownStr != "" { + first := strings.TrimSpace(strings.Split(ownStr, ",")[0]) if n, err := strconv.ParseUint(first, 10, 64); err == nil { owner = n } @@ -1455,7 +1459,10 @@ func (a *ExportsAPI) list(w http.ResponseWriter, r *http.Request) { offset := (page - 1) * size rrepo := repo.NewExportRepo() var totalCount int64 - uidStr := q.Get("userId") + uidStr := q.Get("current_user_id") + if uidStr == "" { + uidStr = q.Get("userId") + } totalCount = rrepo.CountJobs(a.meta, tplID, uidStr) itemsRaw, err := rrepo.ListJobs(a.meta, tplID, uidStr, size, offset) if err != nil {