{"ast":null,"code":"\"use strict\";\n\nvar _apollo = _interopRequireDefault(require(\"../../lib/apollo.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nasync function getTransaction(token = \"\") {\n var res = await _apollo.default.query(`\n query {\n transactions{\n id\n order_id\n cust_name\n cust_telp\n cust_address\n product_img{\n url\n }\n product_name\n product_color\n product_quantity\n product_courier\n product_price\n }\n }`, token);\n return res;\n}\n\nasync function getTransactionUnpaid(token = \"\") {\n var res = await _apollo.default.query(`\n query {\n transactions(where: { status: \"1\" }){\n id\n order_id\n cust_name\n cust_telp\n cust_address\n product_img{\n url\n }\n product_name\n product_color\n product_quantity\n product_courier\n product_price\n }\n }`, token);\n return res;\n}\n\nasync function getTransactionPrepared(token = \"\") {\n var res = await _apollo.default.query(`\n query {\n transactions(where: { status: \"2\" }){\n id\n order_id\n cust_name\n cust_telp\n cust_address\n product_img{\n url\n }\n product_name\n product_color\n product_quantity\n product_courier\n product_price\n }\n }`, token);\n return res;\n}\n\nasync function getTransactionSending(token = \"\") {\n var res = await _apollo.default.query(`\n query {\n transactions(where: { status: \"3\" }){\n id\n order_id\n cust_name\n cust_telp\n cust_address\n product_img{\n url\n }\n product_name\n product_color\n product_quantity\n product_courier\n product_price\n }\n }`, token);\n return res;\n}\n\nasync function getTransactionFinished(token = \"\") {\n var res = await _apollo.default.query(`\n query {\n transactions(where: { status: \"4\" }){\n id\n order_id\n cust_name\n cust_telp\n cust_address\n product_img{\n url\n }\n product_name\n product_color\n product_quantity\n product_courier\n product_price\n }\n }`, token);\n return res;\n}\n\nasync function newTransactionYamaha(content, token = \"\") {\n console.log(\"mastW\");\n var res = await _apollo.default.mutation(`\n mutation($input : TransactionInput!){\n createTransaction( input:{data:$input} )\n {\n transaction{\n id\n }\n }\n }\n `, token, {\n input: content\n });\n return res;\n}\n\nasync function newTransactionSuzuki(content, token = \"\") {\n var res = await _apollo.default.mutation(`\n mutation($input : TransactionInput!){\n createTransaction( input:{data:$input} )\n {\n transactionSuzuki{\n id\n }\n }\n }\n `, token, {\n input: content\n });\n return res;\n}\n\nasync function newTransactionHonda(content, token = \"\") {\n var res = await _apollo.default.mutation(`\n mutation($input : TransactionInput!){\n createTransaction( input:{data:$input} )\n {\n transactionHonda{\n id\n }\n }\n }\n `, token, {\n input: content\n });\n return res;\n}\n\nasync function newTransactionHino(content, token = \"\") {\n var res = await _apollo.default.mutation(`\n mutation($input : TransactionInput!){\n createTransaction( input:{data:$input} )\n {\n transactionHino{\n id\n }\n }\n }\n `, token, {\n input: content\n });\n return res;\n}\n\nmodule.exports = {\n newTransactionYamaha: newTransactionYamaha,\n newTransactionSuzuki: newTransactionSuzuki,\n newTransactionHonda: newTransactionHonda,\n newTransactionHino: newTransactionHino,\n getTransaction: getTransaction,\n getTransactionUnpaid: getTransactionUnpaid,\n getTransactionPrepared: getTransactionPrepared,\n getTransactionSending: getTransactionSending,\n getTransactionFinished: getTransactionFinished\n};","map":{"version":3,"sources":["C:/tbg-ecomm-nextjs/api/transaction/transaction.js"],"names":["getTransaction","token","res","apollo","query","getTransactionUnpaid","getTransactionPrepared","getTransactionSending","getTransactionFinished","newTransactionYamaha","content","console","log","mutation","input","newTransactionSuzuki","newTransactionHonda","newTransactionHino","module","exports"],"mappings":";;AAAA;;;;AAEA,eAAeA,cAAf,CAA8BC,KAAK,GAAG,EAAtC,EAA0C;AACxC,MAAIC,GAAG,GAAG,MAAMC,gBAAOC,KAAP,CACb;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAlBkB,EAmBdH,KAnBc,CAAhB;AAqBA,SAAOC,GAAP;AACD;;AAED,eAAeG,oBAAf,CAAoCJ,KAAK,GAAG,EAA5C,EAAgD;AAC9C,MAAIC,GAAG,GAAG,MAAMC,gBAAOC,KAAP,CACb;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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ACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAVkB,EAWZZ,KAXY,EAYd;AACEa,IAAAA,KAAK,EAAEJ;AADT,GAZc,CAAhB;AAgBF,SAAOR,GAAP;AACC;;AAED,eAAec,mBAAf,CAAmCN,OAAnC,EAA4CT,KAAK,GAAC,EAAlD,EAAsD;AACpD,MAAIC,GAAG,GAAG,MAAMC,gBAAOU,QAAP,CACX;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAVkB,EAWZZ,KAXY,EAYd;AACEa,IAAAA,KAAK,EAAEJ;AADT,GAZc,CAAhB;AAgBF,SAAOR,GAAP;AACC;;AAED,eAAee,kBAAf,CAAkCP,OAAlC,EAA2CT,KAAK,GAAC,EAAjD,EAAqD;AACnD,MAAIC,GAAG,GAAG,MAAMC,gBAAOU,QAAP,CACX;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAVkB,EAWZZ,KAXY,EAYd;AACEa,IAAAA,KAAK,EAAEJ;AADT,GAZc,CAAhB;AAgBF,SAAOR,GAAP;AACC;;AAEDgB,MAAM,CAACC,OAAP,GAAiB;AACbV,EAAAA,oBAAoB,EAAEA,oBADT;AAEbM,EAAAA,oBAAoB,EAAEA,oBAFT;AAGbC,EAAAA,mBAAmB,EAAEA,mBAHR;AAIbC,EAAAA,kBAAkB,EAAEA,kBAJP;AAKbjB,EAAAA,cAAc,EAAEA,cALH;AAMbK,EAAAA,oBAAoB,EAAEA,oBANT;AAObC,EAAAA,sBAAsB,EAAEA,sBAPX;AAQbC,EAAAA,qBAAqB,EAAEA,qBARV;AASbC,EAAAA,sBAAsB,EAAEA;AATX,CAAjB","sourcesContent":["import apollo from \"../../lib/apollo.js\";\r\n\r\nasync function getTransaction(token = \"\") {\r\n var res = await apollo.query(\r\n `\r\n query {\r\n transactions{\r\n id\r\n order_id\r\n cust_name\r\n cust_telp\r\n cust_address\r\n product_img{\r\n url\r\n }\r\n product_name\r\n product_color\r\n product_quantity\r\n product_courier\r\n product_price\r\n }\r\n }`,\r\n token\r\n );\r\n return res;\r\n}\r\n\r\nasync function getTransactionUnpaid(token = \"\") {\r\n var res = await apollo.query(\r\n `\r\n query {\r\n transactions(where: { status: \"1\" }){\r\n id\r\n order_id\r\n cust_name\r\n cust_telp\r\n cust_address\r\n product_img{\r\n url\r\n }\r\n product_name\r\n product_color\r\n product_quantity\r\n product_courier\r\n product_price\r\n }\r\n }`,\r\n token\r\n );\r\n return res;\r\n}\r\n\r\nasync function getTransactionPrepared(token = \"\") {\r\n var res = await apollo.query(\r\n `\r\n query {\r\n transactions(where: { status: \"2\" }){\r\n id\r\n order_id\r\n cust_name\r\n cust_telp\r\n cust_address\r\n product_img{\r\n url\r\n }\r\n product_name\r\n product_color\r\n product_quantity\r\n product_courier\r\n product_price\r\n }\r\n }`,\r\n token\r\n );\r\n return res;\r\n}\r\n\r\nasync function getTransactionSending(token = \"\") {\r\n var res = await apollo.query(\r\n `\r\n query {\r\n transactions(where: { status: \"3\" }){\r\n id\r\n order_id\r\n cust_name\r\n cust_telp\r\n cust_address\r\n product_img{\r\n url\r\n }\r\n product_name\r\n product_color\r\n product_quantity\r\n product_courier\r\n product_price\r\n }\r\n }`,\r\n token\r\n );\r\n return res;\r\n}\r\n\r\nasync function getTransactionFinished(token = \"\") {\r\n var res = await apollo.query(\r\n `\r\n query {\r\n transactions(where: { status: \"4\" }){\r\n id\r\n order_id\r\n cust_name\r\n cust_telp\r\n cust_address\r\n product_img{\r\n url\r\n }\r\n product_name\r\n product_color\r\n product_quantity\r\n product_courier\r\n product_price\r\n }\r\n }`,\r\n token\r\n );\r\n return res;\r\n}\r\n\r\nasync function newTransactionYamaha(content, token=\"\") { \r\n console.log(\"mastW\");\r\n\r\n var res = await apollo.mutation(\r\n `\r\n mutation($input : TransactionInput!){\r\n createTransaction( input:{data:$input} )\r\n {\r\n transaction{\r\n id\r\n }\r\n }\r\n }\r\n `,\r\n token,\r\n {\r\n input: content,\r\n }\r\n );\r\n\treturn res;\r\n}\r\n\r\nasync function newTransactionSuzuki(content, token=\"\") {\r\n var res = await apollo.mutation(\r\n `\r\n mutation($input : TransactionInput!){\r\n createTransaction( input:{data:$input} )\r\n {\r\n transactionSuzuki{\r\n id\r\n }\r\n }\r\n }\r\n `,\r\n token,\r\n {\r\n input: content,\r\n }\r\n );\r\nreturn res;\r\n}\r\n\r\nasync function newTransactionHonda(content, token=\"\") {\r\n var res = await apollo.mutation(\r\n `\r\n mutation($input : TransactionInput!){\r\n createTransaction( input:{data:$input} )\r\n {\r\n transactionHonda{\r\n id\r\n }\r\n }\r\n }\r\n `,\r\n token,\r\n {\r\n input: content,\r\n }\r\n );\r\nreturn res;\r\n}\r\n\r\nasync function newTransactionHino(content, token=\"\") {\r\n var res = await apollo.mutation(\r\n `\r\n mutation($input : TransactionInput!){\r\n createTransaction( input:{data:$input} )\r\n {\r\n transactionHino{\r\n id\r\n }\r\n }\r\n }\r\n `,\r\n token,\r\n {\r\n input: content,\r\n }\r\n );\r\nreturn res;\r\n}\r\n\r\nmodule.exports = {\r\n newTransactionYamaha: newTransactionYamaha,\r\n newTransactionSuzuki: newTransactionSuzuki,\r\n newTransactionHonda: newTransactionHonda,\r\n newTransactionHino: newTransactionHino,\r\n getTransaction: getTransaction,\r\n getTransactionUnpaid: getTransactionUnpaid,\r\n getTransactionPrepared: getTransactionPrepared,\r\n getTransactionSending: getTransactionSending,\r\n getTransactionFinished: getTransactionFinished,\r\n};"]},"metadata":{},"sourceType":"script"}