Skip to content

Commit

Permalink
fix: rename file bug
Browse files Browse the repository at this point in the history
  • Loading branch information
divyam234 committed Aug 3, 2024
1 parent 2a7cedb commit 81c4bd7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
3 changes: 0 additions & 3 deletions pkg/schemas/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,8 @@ type FileOutFull struct {

type FileUpdate struct {
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Starred *bool `json:"starred,omitempty"`
ParentID string `json:"parentId,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
Parts []Part `json:"parts,omitempty"`
Size *int64 `json:"size,omitempty"`
}
Expand Down
7 changes: 1 addition & 6 deletions pkg/services/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,9 @@ func (fs *FileService) UpdateFile(id string, userId int64, update *schemas.FileU
)

updateDb := models.File{
Name: update.Name,
ParentID: sql.NullString{
String: update.ParentID,
Valid: true,
},
Name: update.Name,
UpdatedAt: update.UpdatedAt,
Size: update.Size,
CreatedAt: update.CreatedAt,
}

if update.Starred != nil {
Expand Down
1 change: 0 additions & 1 deletion pkg/services/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ func (s *FileServiceSuite) Test_Update() {
s.NoError(err.Error)
data := &schemas.FileUpdate{
Name: "file3.jpeg",
Type: "file",
}
r, err := s.srv.UpdateFile(res.Id, 123456, data)
s.NoError(err.Error)
Expand Down

0 comments on commit 81c4bd7

Please sign in to comment.