Skip to content

Commit

Permalink
Merge pull request #73 from reactioncommerce/fix-2-create-acc-not-wor…
Browse files Browse the repository at this point in the history
…king

Fix 2 create acc not working
  • Loading branch information
delagroove authored Dec 21, 2021
2 parents 6004df3 + d582c95 commit d398839
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/startup/afterShopCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ export default async function afterShopCreate(context) {

const account = await Accounts.findOne({ userId });

if (account === undefined) {
if (!account) {
throw new ReactionError("not-found", `Could not find account for user ${userId} when granting admin UI access for shop ${shop._id}`);
}
if (shop) {
} else {
await context.mutations.grantAdminUIAccess(context, {
accountId: account._id,
shopId: shop._id
Expand Down

0 comments on commit d398839

Please sign in to comment.