Skip to content

Instantly share code, notes, and snippets.

@denzo
Created November 26, 2017 02:10
Show Gist options
  • Save denzo/9df40c5fd5f02e0474ee976341ee45d7 to your computer and use it in GitHub Desktop.
Save denzo/9df40c5fd5f02e0474ee976341ee45d7 to your computer and use it in GitHub Desktop.
// app/componets/action-details/component.js
setStatus(newStatus) {
const model = get(this, 'model');
if ([0, 10].includes(get(model, 'status')) && [50, 60].includes(newStatus)) {
set(model, 'completedAt', new Date());
}
set(model, 'status', newStatus);
model.save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment