Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
items: {
Default: ItemsList
},
get total() {
let total = 0.0;
this.items.forEach(item =>
total += parseFloat(item.price));
return total.toFixed(2);
},
markAs(status) {
this.status = status;
this.save();
}
});
Order.List = DefineList.extend('OrderList', {
'#': Order
});
Order.connection = superModel({
url: loader.serviceBaseURL + '/api/orders',
Map: Order,
List: Order.List,
name: 'order'
});
export default Order;
import { DefineMap, DefineList, superModel } from 'can';
import loader from '@loader';
const City = DefineMap.extend({
seal: false
}, {
'name': {
type: 'any',
identity: true
}
});
City.List = DefineList.extend({
'#': City
});
City.connection = superModel({
url: loader.serviceBaseURL + '/api/cities',
Map: City,
List: City.List,
name: 'city'
});
export default City;
items: {
Default: ItemsList
},
get total() {
let total = 0.0;
this.items.forEach(item =>
total += parseFloat(item.price));
return total.toFixed(2);
},
markAs(status) {
this.status = status;
this.save();
}
});
Order.List = DefineList.extend({
'#': Order
});
Order.connection = superModel({
url: loader.serviceBaseURL + '/api/orders',
Map: Order,
List: Order.List,
name: 'order'
});
const socket = io(loader.serviceBaseURL);
socket.on('orders created', order => Order.connection.createInstance(order));
socket.on('orders updated', order => {
debugger;
Order.connection.updateInstance(order)
type: 'any',
identity: true
},
menu:{
type: {
lunch: {
Type: ItemsList
},
dinner: {
Type: ItemsList
}
}
}
});
Restaurant.List = DefineList.extend({
'#': Restaurant
});
Restaurant.connection = superModel({
url: loader.serviceBaseURL + '/api/restaurants',
Map: Restaurant,
List: Restaurant.List,
name: 'restaurant'
});
export default Restaurant;
items: {
Default: ItemsList
},
get total() {
let total = 0.0;
this.items.forEach(item =>
total += parseFloat(item.price));
return total.toFixed(2);
},
markAs(status) {
this.status = status;
this.save();
}
});
Order.List = DefineList.extend('OrderList', {
'#': Order
});
Order.connection = superModel({
url: loader.serviceBaseURL + '/api/orders',
Map: Order,
List: Order.List,
name: 'order'
});
export default Order;
import { DefineMap, DefineList, superModel } from 'can';
import loader from '@loader';
import io from 'steal-socket.io';
const Message = DefineMap.extend('Message', {
seal: false
}, {
'id': {
type: 'any',
identity: true
},
name: 'string',
body: 'string'
});
Message.List = DefineList.extend('MessageList', {
'#': Message
});
Message.connection = superModel({
url: loader.serviceBaseURL + '/api/messages',
Map: Message,
List: Message.List,
name: 'message'
});
const socket = io(loader.serviceBaseURL);
socket.on('messages created',
message => Message.connection.createInstance(message));
socket.on('messages updated',
message => Message.connection.updateInstance(message));
items: {
Default: ItemsList
},
get total() {
let total = 0.0;
this.items.forEach(item =>
total += parseFloat(item.price));
return total.toFixed(2);
},
markAs(status) {
this.status = status;
this.save();
}
});
Order.List = DefineList.extend('OrderList', {
'#': Order
});
Order.connection = superModel({
url: loader.serviceBaseURL + '/api/orders',
Map: Order,
List: Order.List,
name: 'order'
});
const socket = io(loader.serviceBaseURL);
socket.on('orders created', order => Order.connection.createInstance(order));
socket.on('orders updated', order => Order.connection.updateInstance(order));
socket.on('orders removed', order => Order.connection.destroyInstance(order));
import { DefineMap, DefineList, superModel } from 'can';
import loader from '@loader';
const Message = DefineMap.extend('Message', {
seal: false
}, {
'id': {
type: 'any',
identity: true
},
name: 'string',
body: 'string'
});
Message.List = DefineList.extend('MessageList', {
'#': Message
});
Message.connection = superModel({
url: loader.serviceBaseURL + '/api/messages',
Map: Message,
List: Message.List,
name: 'message'
});
export default Message;
import { DefineMap, DefineList, superModel } from 'can';
import loader from '@loader';
const State = DefineMap.extend({
seal: false
}, {
'short': {
type: 'any',
identity: true
}
});
State.List = DefineList.extend({
'#': State
});
State.connection = superModel({
url: loader.serviceBaseURL + '/api/states',
Map: State,
List: State.List,
name: 'state'
});
export default State;