Skip to content

fix(db): demote other project domains when domain isPrimary is updated (#718) - #722

Open
chbndrhnns wants to merge 1 commit into
oblien:mainfrom
chbndrhnns:fix/domain-update-primary-invariant
Open

fix(db): demote other project domains when domain isPrimary is updated (#718)#722
chbndrhnns wants to merge 1 commit into
oblien:mainfrom
chbndrhnns:fix/domain-update-primary-invariant

Conversation

@chbndrhnns

Copy link
Copy Markdown
Contributor

Closes #718

Changes

  • In packages/db/src/repos/domain.repo.ts, updated repos.domain.update to check if data.isPrimary is true and call promotePrimary(row.projectId, id) to demote existing primary domains for that project before applying the update.
  • Added repository unit test asserting that updating a secondary domain with isPrimary: true demotes existing primary domains for the same project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] repos.domain.update allows multiple domain rows for a project to have isPrimary: true

1 participant