Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
perfectmak committed Oct 22, 2020
2 parents e51b415 + 84ba0fb commit b2f00da
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions core/ipfs/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,9 @@ func DownloadIpfsItem(ctx context.Context, gatewayUrl string, cid cid.Cid) (io.R
return nil, err
}

if resp.StatusCode != 200 {
return nil, fmt.Errorf("failed to fetch item: status_code %d", resp.StatusCode)
}

return resp.Body, nil
}
4 changes: 2 additions & 2 deletions core/space/services/services_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ func (s *Space) listDirAtPath(
SizeInBytes: strconv.FormatInt(item.Size, 10),
FileExtension: strings.Replace(filepath.Ext(item.Name), ".", "", -1),
// FIXME: real created at needed
Created: time.Unix(item.Metadata.UpdatedAt, 0).Format(time.RFC3339),
Updated: time.Unix(item.Metadata.UpdatedAt, 0).Format(time.RFC3339),
Created: time.Unix(0, item.Metadata.UpdatedAt).Format(time.RFC3339),
Updated: time.Unix(0, item.Metadata.UpdatedAt).Format(time.RFC3339),
Members: members,
},
IpfsHash: item.Cid,
Expand Down
3 changes: 3 additions & 0 deletions core/textile/model/received_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ func (m *model) CreateReceivedFileViaPublicLink(
FileName: filename,
FileSize: fileSize,
},
ReceivedFileViaInvitationSchema: ReceivedFileViaInvitationSchema{
EncryptionKey: []byte(""),
},
Accepted: accepted,
CreatedAt: time.Now().UnixNano(),
}
Expand Down
8 changes: 4 additions & 4 deletions core/textile/sharing.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ func (tc *textileClient) buildPublicLinkSharedDirEntry(
Name: file.FileName,
SizeInBytes: file.FileSize,
FileExtension: strings.Replace(filepath.Ext(file.FileName), ".", "", -1),
Created: strconv.FormatInt(time.Unix(0, file.CreatedAt).Unix(), 10),
Updated: strconv.FormatInt(time.Unix(0, file.CreatedAt).Unix(), 10),
Created: time.Unix(0, file.CreatedAt).Format(time.RFC3339),
Updated: time.Unix(0, file.CreatedAt).Format(time.RFC3339),
},
},
Members: []domain.Member{},
Expand Down Expand Up @@ -301,8 +301,8 @@ func (tc *textileClient) buildInvitationSharedDirEntry(
Name: name,
SizeInBytes: strconv.FormatInt(size, 10),
FileExtension: ext,
Created: strconv.FormatInt(time.Unix(0, file.CreatedAt).Unix(), 10),
Updated: strconv.FormatInt(time.Unix(updatedAt, 0).Unix(), 10),
Created: time.Unix(0, file.CreatedAt).Format(time.RFC3339),
Updated: time.Unix(0, updatedAt).Format(time.RFC3339),
},
},
Members: members,
Expand Down

0 comments on commit b2f00da

Please sign in to comment.