mirror of
https://github.com/tgdrive/teldrive.git
synced 2024-12-30 20:01:47 +08:00
fix: rename file bug
This commit is contained in:
parent
2a7cedb6fb
commit
81c4bd775a
3 changed files with 1 additions and 10 deletions
|
@ -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"`
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue