fix version 1
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
|
||||
// 撤销关注
|
||||
func Undo(ctx context.Context, in *pb.IdentRequest) (reply *pb.DataStatusReply, err error) {
|
||||
_, err = service.ParseMetaCtx(ctx, nil)
|
||||
auth, err := service.ParseMetaCtx(ctx, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -23,7 +23,8 @@ func Undo(ctx context.Context, in *pb.IdentRequest) (reply *pb.DataStatusReply,
|
||||
return nil, errcode.ErrInvalidArgument
|
||||
}
|
||||
|
||||
err = impl.DBService.Model(&models.RelationFollow{}).Delete("identity=?", in.Identity).Error
|
||||
// 只能撤销自己发起的关注:归属列是 from_identity
|
||||
err = impl.DBService.Model(&models.RelationFollow{}).Delete("identity=? and from_identity=?", in.Identity, auth.Identity).Error
|
||||
if err != nil {
|
||||
printer.Error(err.Error())
|
||||
return nil, errcode.ErrDB
|
||||
|
||||
Reference in New Issue
Block a user