add array nested schema
This commit is contained in:
parent
ed4d366057
commit
0526b7ac18
|
@ -68,10 +68,9 @@ export class AppController {
|
|||
@Body('quote') quote: number,
|
||||
@Body('status') status: string,
|
||||
@Body('date_entry') date_entry: Date,
|
||||
@Body('houses') houses: {},
|
||||
@Body('houses') houses: [{}],
|
||||
|
||||
) {
|
||||
console.log(houses);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ export class AppService {
|
|||
|
||||
//POST parameter from API
|
||||
createCommunity(name: string, province: string, canton: string, district: string
|
||||
, num_houses: number, phone: number, quote: number, status: string, date_entry: Date, houses: {}) {
|
||||
, num_houses: number, phone: number, quote: number, status: string, date_entry: Date, houses: [{}]) {
|
||||
const pattern = { cmd: 'createCommunity' };
|
||||
const payload = {
|
||||
name: name, province: province, canton: canton, district: district, num_houses: num_houses,
|
||||
|
@ -81,6 +81,8 @@ export class AppService {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
allCommunities() {
|
||||
const pattern = { cmd: 'findAllCommunities' };
|
||||
const payload = {};
|
||||
|
|
|
@ -35,8 +35,8 @@ export class Community {
|
|||
@Prop()
|
||||
date_entry: Date;
|
||||
|
||||
@Prop({ type: HouseSchema })
|
||||
houses: House
|
||||
@Prop({ type: [HouseSchema] })
|
||||
houses: Array<House>;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue