Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 

57 rader
1.3 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. stock
  15. }
  16. }
  17. `,
  18. token, {
  19. "input": id
  20. }
  21. );
  22. return res;
  23. }
  24. async function GetCheckoutproductBayar(id, token = "") {
  25. var res = await apollo.query(
  26. `
  27. query($input: ID!) {
  28. transaction(id:$input where: { status: "2" }) {
  29. id
  30. order_id
  31. cust_name
  32. cust_telp
  33. cust_address
  34. product_img{
  35. url
  36. }
  37. product_name
  38. product_color
  39. product_quantity
  40. product_courier
  41. product_price
  42. }
  43. }
  44. `,
  45. token, {
  46. "input": id
  47. }
  48. );
  49. return res;
  50. }
  51. module.exports = {
  52. GetCheckoutproduct: GetCheckoutproduct,
  53. GetCheckoutproductBayar: GetCheckoutproductBayar,
  54. };