- Linting... Prettier...
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
import { List, Record } from 'immutable';
|
||||
|
||||
export default class TicketClass extends Record({
|
||||
available: 0,
|
||||
capacity: 0,
|
||||
endSale: null,
|
||||
id: null,
|
||||
itemId: null,
|
||||
name: null,
|
||||
price: 0,
|
||||
startSale: null,
|
||||
available: 0,
|
||||
capacity: 0,
|
||||
endSale: null,
|
||||
id: null,
|
||||
itemId: null,
|
||||
name: null,
|
||||
price: 0,
|
||||
startSale: null,
|
||||
}) {
|
||||
get isAlmostGone() {
|
||||
return this.available < (this.capacity * 0.20);
|
||||
}
|
||||
get isAlmostGone() {
|
||||
return this.available < this.capacity * 0.2;
|
||||
}
|
||||
|
||||
get isSoldOut() {
|
||||
return this.available === 0;
|
||||
}
|
||||
get isSoldOut() {
|
||||
return this.available === 0;
|
||||
}
|
||||
}
|
||||
|
||||
TicketClass.fromJS = (data = {}) => {
|
||||
return new TicketClass({
|
||||
id: data._id,
|
||||
...data,
|
||||
});
|
||||
return new TicketClass({
|
||||
id: data._id,
|
||||
...data,
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user