Skip to content

Commit

Permalink
Updating conditional statement in deleteItem mutation resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
scrumptiousdev committed Sep 21, 2018
1 parent 8b60ee7 commit e4cfa16
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion finished-application/backend/src/resolvers/Mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Mutations = {
['ADMIN', 'ITEMDELETE'].includes(permission)
);

if (!ownsItem && hasPermissions) {
if (!ownsItem && !hasPermissions) {
throw new Error("You don't have permission to do that!");
}

Expand Down
2 changes: 1 addition & 1 deletion stepped-solutions/38/backend/src/resolvers/Mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const Mutations = {
['ADMIN', 'ITEMDELETE'].includes(permission)
);

if (!ownsItem && hasPermissions) {
if (!ownsItem && !hasPermissions) {
throw new Error("You don't have permission to do that!");
}

Expand Down
2 changes: 1 addition & 1 deletion stepped-solutions/41/backend/src/resolvers/Mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const Mutations = {
['ADMIN', 'ITEMDELETE'].includes(permission)
);

if (!ownsItem && hasPermissions) {
if (!ownsItem && !hasPermissions) {
throw new Error("You don't have permission to do that!");
}

Expand Down
2 changes: 1 addition & 1 deletion stepped-solutions/43/backend/src/resolvers/Mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const Mutations = {
['ADMIN', 'ITEMDELETE'].includes(permission)
);

if (!ownsItem && hasPermissions) {
if (!ownsItem && !hasPermissions) {
throw new Error("You don't have permission to do that!");
}

Expand Down
2 changes: 1 addition & 1 deletion stepped-solutions/51/backend/src/resolvers/Mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Mutations = {
['ADMIN', 'ITEMDELETE'].includes(permission)
);

if (!ownsItem && hasPermissions) {
if (!ownsItem && !hasPermissions) {
throw new Error("You don't have permission to do that!");
}

Expand Down
2 changes: 1 addition & 1 deletion stepped-solutions/52/backend/src/resolvers/Mutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const Mutations = {
['ADMIN', 'ITEMDELETE'].includes(permission)
);

if (!ownsItem && hasPermissions) {
if (!ownsItem && !hasPermissions) {
throw new Error("You don't have permission to do that!");
}

Expand Down

0 comments on commit e4cfa16

Please sign in to comment.