diff --git a/services/user/rollbacks.go b/services/user/rollbacks.go deleted file mode 100644 index ddf0720..0000000 --- a/services/user/rollbacks.go +++ /dev/null @@ -1,36 +0,0 @@ -package user - -import ( - "context" - "github.com/CastyLab/grpc.proto/proto" - "github.com/CastyLab/grpc.server/db" - "go.mongodb.org/mongo-driver/bson" - "net/http" -) - -func (s *Service) RollbackStates(ctx context.Context, req *proto.RollbackStatesRequest) (*proto.Response, error) { - - var ( - collection = db.Connection.Collection("users") - update = bson.M{ - "$set": bson.M{ - "state": int(proto.PERSONAL_STATE_OFFLINE), - }, - } - // filter non online users - filter = bson.M{ - "state": bson.M{ - "$ne": int(proto.PERSONAL_STATE_OFFLINE), - }, - } - ) - - if _, err := collection.UpdateMany(ctx, filter, update); err != nil { - return nil, err - } - - return &proto.Response{ - Status: "Success", - Code: http.StatusOK, - }, nil -} \ No newline at end of file