Ver a proveniência

update order API structure changes

master
kj1352 há 4 anos
ascendente
cometimento
18c31a09aa
4 ficheiros alterados com 83 adições e 2 eliminações
  1. +16
    -0
      .firebase/hosting.ZGlzdC92ZW5kb3ItYXBw.cache
  2. +17
    -0
      firebase-debug.log
  3. +25
    -1
      src/app/dashboard/dashboard.component.ts
  4. +25
    -1
      src/app/orders/orders.component.ts

+ 16
- 0
.firebase/hosting.ZGlzdC92ZW5kb3ItYXBw.cache Ver ficheiro

@@ -0,0 +1,16 @@
favicon.ico,1607952081261,a2aee5309d0b59b9b66384ccc3969a07fab1b320d0bf76f1b25047a051d7f774
index.html,1607952099256,1600639386bd54cc450463a5cc55597445fccb9e3f9d648c2214c6ebb6b9d3fe
3rdpartylicenses.txt,1607952081259,ba218377b44a5ec62b8d85472da773a88893601972bd99ccb0e927d7010da809
polyfills-es2015.5b10b8fd823b6392f1fd.js,1607952083361,82b136c9661df6035797722901e849107a79cb4d2f601cf1d37bef50bf748c25
runtime-es2015.c5fa8325f89fc516600b.js,1607952082316,c4aa0a348c0dcf9c6af4b7b3f066d0599bcec97472ed96ab232c8dceb70607cb
runtime-es5.c5fa8325f89fc516600b.js,1607952082746,c4aa0a348c0dcf9c6af4b7b3f066d0599bcec97472ed96ab232c8dceb70607cb
assets/logo.svg,1607952081261,7ce7bfefb18eaba9717f40992e0f44e7aa9aea1a12c385621f87e550d07507b5
styles.d5b1b1107483ebf486f9.css,1607952081260,f105151fbf96b2f8a51c918ba20bb6e553186903ed6e42a8d2405bb43ccb4a26
ionicons.96f1c901c087fb64019f.woff2,1607952081259,93a6cfdb340efa15a711b1aa8524031b6f2aa68a912521fc1b97880e5f970ddd
ionicons.99b863497156d4478ec3.woff,1607952081260,cdce2111340a0888bf32c15491ab0feba340e289ff213793c5fc7bd82fcbe91f
ionicons.a558ac78b554eefa1817.eot,1607952081260,1762cb70efe1ff2613db43496a2fc11a3216530411af2ceebc0707dc2a1d4ac4
ionicons.ef4a9f280b0e411ddf6c.ttf,1607952081260,f26df0ae0db088693c50cd143bb3391ba2b45f4ee35770fc5d4254dac2510492
polyfills-es5.3e8196928d184a6e5319.js,1607952092335,9bc51b1036e9ce398e58dbccf906d1152d01b1ea2811ab35288d653f9d2e7fea
ionicons.d659209138fc7c28c23a.svg,1607952081261,e1f9cd1e9b409c9625989f870db98037c1104b45c8b8c9ab00d1b17a3474427f
main-es2015.4e59cac2fd134ac532c3.js,1607952099233,6b07282589db823c2b91afd0bddb0b01085c5f62eb146b47711ae219d8a465b8
main-es5.4e59cac2fd134ac532c3.js,1607952097145,6f537c4dd2d7c019c63fc321260c6453dd5eb2b2e0a2b22d5c0eb63fa34654d0

+ 17
- 0
firebase-debug.log Ver ficheiro

@@ -0,0 +1,17 @@
[debug] [2020-12-14T14:23:53.698Z] ----------------------------------------------------------------------
[debug] [2020-12-14T14:23:53.700Z] Command: /usr/local/bin/firebase /Users/kj1352/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/bin/firebase deploy
[debug] [2020-12-14T14:23:53.701Z] CLI Version: 8.19.0
[debug] [2020-12-14T14:23:53.701Z] Platform: darwin
[debug] [2020-12-14T14:23:53.701Z] Node Version: v12.18.1
[debug] [2020-12-14T14:23:53.712Z] Time: Mon Dec 14 2020 19:53:53 GMT+0530 (India Standard Time)
[debug] [2020-12-14T14:23:53.713Z] ----------------------------------------------------------------------
[debug] [2020-12-14T14:23:53.713Z]
[debug] [2020-12-14T14:23:53.729Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2020-12-14T14:23:53.730Z] > authorizing via signed-in user
[debug] [2020-12-14T14:23:53.730Z] [iam] checking project vendor-app-20 for permissions ["firebase.projects.get","firebasehosting.sites.update"]
[debug] [2020-12-14T14:23:53.736Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] [2020-12-14T14:23:53.737Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2020-12-14T14:23:53.957Z] <<< HTTP RESPONSE 200 {"expires":"Mon, 01 Jan 1990 00:00:00 GMT","pragma":"no-cache","cache-control":"no-cache, no-store, max-age=0, must-revalidate","date":"Mon, 14 Dec 2020 14:23:54 GMT","content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"scaffolding on HTTPServer2","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-14T14:23:53.978Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/vendor-app-20:testIamPermissions
{"permissions":["firebase.projects.get","firebasehosting.sites.update"]}

+ 25
- 1
src/app/dashboard/dashboard.component.ts Ver ficheiro

@@ -66,8 +66,32 @@ export class DashboardComponent implements OnInit {
}
}

getOrderInUsercartFormat(orderedlist: any) {
let compiledOrderedList: any = [];

for (let i = 0; i < orderedlist.length; i += 1) {
compiledOrderedList.push({
mall_id: orderedlist[i].mall_id,
outlet_id: orderedlist[i].outlet_id,
menuitem_id: orderedlist[i].menuitems.menuitem_id,
quantity: orderedlist[i].quantity,
pickup_time: moment().add(moment.duration(orderedlist[i].menuitems.wait_duration).asMinutes(), 'minutes').format(),
take_away: true,
order_status: null,
total_price: orderedlist[i].total_price,
soft_delete: false,
});
}

return compiledOrderedList;
}

updateOrder(order) {
this.orderService.updateOrder(order).then((data) => {
let tempOrder = order;

tempOrder.orderedlist = this.getOrderInUsercartFormat(order.orderedlist);

this.orderService.updateOrder(tempOrder).then((data) => {
console.log(data);
}, (err) => {
console.log(err)


+ 25
- 1
src/app/orders/orders.component.ts Ver ficheiro

@@ -100,8 +100,32 @@ export class OrdersComponent implements OnInit {
});
}

getOrderInUsercartFormat(orderedlist: any) {
let compiledOrderedList: any = [];

for (let i = 0; i < orderedlist.length; i += 1) {
compiledOrderedList.push({
mall_id: orderedlist[i].mall_id,
outlet_id: orderedlist[i].outlet_id,
menuitem_id: orderedlist[i].menuitems.menuitem_id,
quantity: orderedlist[i].quantity,
pickup_time: moment().add(moment.duration(orderedlist[i].menuitems.wait_duration).asMinutes(), 'minutes').format(),
take_away: true,
order_status: null,
total_price: orderedlist[i].total_price,
soft_delete: false,
});
}

return compiledOrderedList;
}

updateOrder(order) {
this.orderService.updateOrder(order).then((data) => {
let tempOrder = order;

tempOrder.orderedlist = this.getOrderInUsercartFormat(order.orderedlist);

this.orderService.updateOrder(tempOrder).then((data) => {
console.log(data);
}, (err) => {
console.log(err)


Carregando…
Cancelar
Guardar