fix: rename file bug

This commit is contained in:
divyam234 2024-08-03 19:14:03 +05:30
parent 2a7cedb6fb
commit 81c4bd775a
3 changed files with 1 additions and 10 deletions

View file

@ -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"`
}

View file

@ -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 {

View file

@ -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)