|
@@ -97,6 +97,14 @@ func (a *ProductController) Put() {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ if product.ProductImage == "" {
|
|
|
+ old, _ := a.Service.QueryOne(a.Token.getVendorID(a.Ctx), product.ProductKey)
|
|
|
+ arg := &rpcs.ArgsDeleteFile{
|
|
|
+ FileName: old.ProductImage,
|
|
|
+ }
|
|
|
+ reply := &rpcs.ReplyEmptyResult{}
|
|
|
+ server.RPCCallByName("fileaccess", "FileAccess.DeleteFile", arg, reply)
|
|
|
+ }
|
|
|
pro, err := a.Service.Update(product)
|
|
|
if err != nil {
|
|
|
responseError(a.Ctx, ErrDatabase, err.Error())
|