From 9350d6bca8efcf36a33e406dfddf07963aab3d20 Mon Sep 17 00:00:00 2001
From: ShivaniDhoke <shivani.dhoke@eminds.ai>
Date: Mon, 8 Jan 2024 17:05:45 +0530
Subject: [PATCH] fixed some changes in jsonata

---
 mappings/cancel.jsonata    | 4 ++--
 mappings/on_cancel.jsonata | 2 +-
 src/gcl/gcl.service.ts     | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/mappings/cancel.jsonata b/mappings/cancel.jsonata
index 1af3ce8..064b939 100644
--- a/mappings/cancel.jsonata
+++ b/mappings/cancel.jsonata
@@ -1,4 +1,4 @@
-{
+$.data.{
     "context": $context(context, $action),
     "message": message
-}
+}[]
diff --git a/mappings/on_cancel.jsonata b/mappings/on_cancel.jsonata
index 9018d19..35a9d8d 100644
--- a/mappings/on_cancel.jsonata
+++ b/mappings/on_cancel.jsonata
@@ -28,7 +28,7 @@
                     "rateable": rateable,
                     "time": time,
                     "quantity": quantity
-                },
+                }[],
                 "fulfillments": message.order.fulfillments,
                 "quote": message.order.quote,
                 "billing": message.order.billing,
diff --git a/src/gcl/gcl.service.ts b/src/gcl/gcl.service.ts
index ba3372a..151c10d 100644
--- a/src/gcl/gcl.service.ts
+++ b/src/gcl/gcl.service.ts
@@ -7,7 +7,7 @@ export class GCLService {
   constructor(
     @inject(TLService) private tlService: TLService,
     @inject(PSClientService) private psClientService: PSClientService
-  ) { }
+  ) {}
 
   async search(body: any) {
     const payload = await this.tlService.transform(body, "search");
@@ -59,7 +59,7 @@ export class GCLService {
 
   async cancel(body: any) {
     const payload = await this.tlService.transform(body, "cancel");
-    const psResponse = await this.psClientService.post(payload);
+    const psResponse = await this.psClientService.postMany(payload);
     const response = await this.tlService.transform(psResponse, "on_cancel");
 
     return response;
-- 
GitLab