Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
🐛 Fix organization username change
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Jun 23, 2019
1 parent 6d9e643 commit 7a68d15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "staart",
"version": "1.0.34",
"version": "1.0.35",
"main": "index.js",
"repository": "[email protected]:AnandChowdhary/staart.git",
"author": "Anand Chowdhary <[email protected]>",
Expand Down
5 changes: 3 additions & 2 deletions src/crud/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ export const updateOrganization = async (
) => {
organization.updatedAt = dateToDateTime(new Date());
organization = removeReadOnlyValues(organization);
if (organization.username) {
const originalOrganization = await getOrganization(id);
if (organization.username && originalOrganization.username) {
const currentOwner = await getOrganizationIdFromUsername(
organization.username
originalOrganization.username
);
if (currentOwner != id) throw new Error(ErrorCode.USERNAME_EXISTS);
}
Expand Down

0 comments on commit 7a68d15

Please sign in to comment.