Skip to content

Commit

Permalink
fix: Only prevent fulfilled or pending order users from deletion (#5432)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamareebjamal authored Oct 30, 2020
1 parent aecfed4 commit af11e15
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/routes/account/danger-zone.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ export default class DangerZoneRoute extends Route.extend(AuthenticatedRouteMixi
}

async model() {

const user = this.authManager.currentUser;

const filter = [{
or: ['completed', 'placed', 'pending', 'initializing'].map(val => ({
name : 'status',
op : 'eq',
val
}))
}];

const events = await user.query('events', {});
const orders = await user.query('orders', {});
const orders = await user.query('orders', { filter });

return {
user,
Expand Down

1 comment on commit af11e15

@vercel
Copy link

@vercel vercel bot commented on af11e15 Oct 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.