mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-10-10 04:53:09 +08:00
fix(drivers/189pc): pass pointer to RenameResp in Rename method (#2647)
Rename function passed RenameResp by value instead of pointer, causing the API response to be discarded and producing a zero-value file entry with empty name, zero size, and zero timestamps after rename.
This commit is contained in:
@@ -291,7 +291,7 @@ func (y *Cloud189PC) Rename(ctx context.Context, srcObj model.Obj, newName strin
|
||||
var resp RenameResp
|
||||
_, err := y.request(fullUrl, method, func(req *resty.Request) {
|
||||
req.SetContext(ctx).SetQueryParams(queryParam)
|
||||
}, nil, resp, isFamily)
|
||||
}, nil, &resp, isFamily)
|
||||
if err != nil {
|
||||
if code, ok := resp.ResCode.(string); ok && code == "FileAlreadyExists" {
|
||||
return nil, errs.ObjectAlreadyExists
|
||||
|
||||
Reference in New Issue
Block a user