@@ -57,6 +57,24 @@ export interface IProductRootObject {
57
57
58
58
type TUpdatedItems = { key : string ; quantity : number } [ ] ;
59
59
60
+ export interface IUpdateCartItem {
61
+ key : string ;
62
+ quantity : number ;
63
+ }
64
+
65
+ export interface IUpdateCartInput {
66
+ clientMutationId : string ;
67
+ items : IUpdateCartItem [ ] ;
68
+ }
69
+
70
+ export interface IUpdateCartVariables {
71
+ input : IUpdateCartInput ;
72
+ }
73
+
74
+ export interface IUpdateCartRootObject {
75
+ variables : IUpdateCartVariables ;
76
+ }
77
+
60
78
/* Interface for props */
61
79
62
80
interface IFormattedCartProps {
@@ -271,7 +289,7 @@ export const handleQuantityChange = (
271
289
event : ChangeEvent < HTMLInputElement > ,
272
290
cartKey : string ,
273
291
cart : IProductRootObject [ ] ,
274
- updateCart : any , // Lazy solution, but saves us from a lot of warnings
292
+ updateCart : ( variables : IUpdateCartRootObject ) => void ,
275
293
updateCartProcessing : boolean
276
294
) => {
277
295
if ( process . browser ) {
@@ -288,6 +306,15 @@ export const handleQuantityChange = (
288
306
if ( cart . length ) {
289
307
const updatedItems = getUpdatedItems ( cart , newQty , cartKey ) ;
290
308
309
+ const test = {
310
+ variables : {
311
+ input : {
312
+ clientMutationId : uuidv4 ( ) ,
313
+ items : updatedItems ,
314
+ } ,
315
+ } ,
316
+ } ;
317
+
291
318
updateCart ( {
292
319
variables : {
293
320
input : {
0 commit comments