mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-13 02:56:24 +05:00
Fix StorageMongo.RemoveDestination
This commit is contained in:
@@ -924,9 +924,9 @@ func testOnStorITCRUDDestination(t *testing.T) {
|
||||
} else if !reflect.DeepEqual(dst, rcv) {
|
||||
t.Errorf("Expecting: %v, received: %v", dst, rcv)
|
||||
}
|
||||
//FixMe if err = onStor.RemoveDestination(dst.Id, utils.NonTransactional); err != nil {
|
||||
// t.Error(err)
|
||||
// }
|
||||
if err = onStor.RemoveDestination(dst.Id, utils.NonTransactional); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
// if _, rcvErr := onStor.GetDestination(dst.Id, true, utils.NonTransactional); rcvErr != utils.ErrNotFound {
|
||||
// t.Error(rcvErr)
|
||||
// }
|
||||
|
||||
@@ -922,9 +922,12 @@ func (ms *MongoStorage) RemoveDestination(destID string, transactionID string) (
|
||||
// get destination for prefix list
|
||||
d, err := ms.GetDestination(destID, false, transactionID)
|
||||
if err != nil {
|
||||
if err == mgo.ErrNotFound {
|
||||
err = nil
|
||||
}
|
||||
return
|
||||
}
|
||||
err = col.Remove(bson.M{"key": key})
|
||||
err = col.Remove(bson.M{"key": destID})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user