選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

59 行
1.2 KiB

  1. import apollo from "../../lib/apollo.js";
  2. async function GetCheckoutproduct(id, token = "") {
  3. var res = await apollo.query(
  4. `
  5. query($input: ID!){
  6. products(where:{id:$input})
  7. {
  8. name
  9. price
  10. description
  11. img{
  12. url
  13. }
  14. overview
  15. specification
  16. film
  17. stock
  18. }
  19. } `,
  20. token, {
  21. "input": id
  22. }
  23. );
  24. return res;
  25. }
  26. async function GetCheckoutproductBayar(id, token = "") {
  27. var res = await apollo.query(
  28. `
  29. query($input: ID!) {
  30. transaction(id:$input where: { status: "2" }) {
  31. id
  32. order_id
  33. cust_name
  34. cust_telp
  35. cust_address
  36. product_img{
  37. url
  38. }
  39. product_name
  40. product_color
  41. product_quantity
  42. product_courier
  43. product_price
  44. }
  45. }
  46. `,
  47. token, {
  48. "input": id
  49. }
  50. );
  51. return res;
  52. }
  53. module.exports = {
  54. GetCheckoutproduct: GetCheckoutproduct,
  55. GetCheckoutproductBayar: GetCheckoutproductBayar,
  56. };