Skip to content

Commit

Permalink
Revert "feat: add file size to files api"
Browse files Browse the repository at this point in the history
This reverts commit ca3185e.
  • Loading branch information
MalinAhlberg committed Nov 30, 2023
1 parent 8caa156 commit 4f8255d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions sda/internal/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ type SyncData struct {
}

type SubmissionFileInfo struct {
InboxPath string `json:"inboxPath"`
Status string `json:"fileStatus"`
CreateAt string `json:"createAt"`
FileSize sql.NullInt64 `json:"submission_file_size"`
InboxPath string `json:"inboxPath"`
Status string `json:"fileStatus"`
CreateAt string `json:"createAt"`
}

// SchemaName is the name of the remote database schema to query
Expand Down
4 changes: 2 additions & 2 deletions sda/internal/database/db_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ func (dbs *SDAdb) getUserFiles(userID string) ([]*SubmissionFileInfo, error) {
db := dbs.DB

// select all files of the user, each one annotated with its latest event
const query = "SELECT f.submission_file_path, e.event, f.created_at, f.submission_file_size " +
const query = "SELECT f.submission_file_path, e.event, f.created_at " +
"FROM sda.files f " +
"LEFT JOIN ( " +
"SELECT DISTINCT ON (file_id) file_id, started_at, event " +
Expand All @@ -669,7 +669,7 @@ func (dbs *SDAdb) getUserFiles(userID string) ([]*SubmissionFileInfo, error) {
for rows.Next() {
// Read rows into struct
fi := &SubmissionFileInfo{}
err := rows.Scan(&fi.InboxPath, &fi.Status, &fi.CreateAt, &fi.FileSize)
err := rows.Scan(&fi.InboxPath, &fi.Status, &fi.CreateAt)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 4f8255d

Please sign in to comment.