fix: Fixed paddle relink sub
This commit is contained in:
@@ -124,9 +124,9 @@ func handleSubscription(ctx context.Context, ev Event) error {
|
||||
}
|
||||
|
||||
// resolveInstance finds the instance a webhook's custom_data names, following the
|
||||
// placeholder alias when the id is one a self-hosted claim has since replaced.
|
||||
// It returns the instance's CURRENT id, which is the only id anything else should
|
||||
// be written against.
|
||||
// identity trail when the id is one a placeholder claim or a relink has since
|
||||
// replaced. It returns the instance's CURRENT id, which is the only id anything
|
||||
// else should be written against.
|
||||
func resolveInstance(ctx context.Context, customDataID string) (string, models.Instance, error) {
|
||||
var inst models.Instance
|
||||
err := db.Admin("admin_instances").FindOne(ctx,
|
||||
@@ -138,7 +138,7 @@ func resolveInstance(ctx context.Context, customDataID string) (string, models.I
|
||||
return "", inst, err
|
||||
}
|
||||
if err := db.Admin("admin_instances").FindOne(ctx,
|
||||
bson.M{"linked_from_placeholder_id": customDataID}).Decode(&inst); err != nil {
|
||||
bson.M{"previous_instance_ids": customDataID}).Decode(&inst); err != nil {
|
||||
return "", inst, err
|
||||
}
|
||||
return inst.InstanceID, inst, nil
|
||||
|
||||
Reference in New Issue
Block a user