Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

148 řádky
3.2 KiB

  1. import apollo from "../../lib/apollo.js";
  2. async function GetCarrerS1Yamaha(token="") {
  3. var res = await apollo.query(
  4. `
  5. query {
  6. carrers(where: {category: "S1" business_partner: "1"})
  7. {
  8. id
  9. name
  10. start_regis
  11. until_regis
  12. name_description
  13. }
  14. }`,
  15. token
  16. );
  17. return res;
  18. }
  19. async function GetCarrerD3Yamaha(token="") {
  20. var res = await apollo.query(
  21. `
  22. query {
  23. carrers(where: {category: "D3" business_partner: "1"})
  24. {
  25. id
  26. name
  27. start_regis
  28. until_regis
  29. name_description
  30. }
  31. }`,
  32. token
  33. );
  34. return res;
  35. }
  36. async function GetCarrerSMAYamaha(token="") {
  37. var res = await apollo.query(
  38. `
  39. query {
  40. carrers(where: {category: "SMA" business_partner: "1"})
  41. {
  42. id
  43. name
  44. start_regis
  45. until_regis
  46. name_description
  47. }
  48. }`,
  49. token
  50. );
  51. return res;
  52. }
  53. async function GetDetailCarrer(id, token="") {
  54. var res = await apollo.query(
  55. `
  56. query($input: ID!){
  57. carrers(where:{id:$input})
  58. {
  59. name
  60. description
  61. category
  62. img{
  63. url
  64. }
  65. start_regis
  66. until_regis
  67. name_description
  68. }
  69. }
  70. `,
  71. token,
  72. {
  73. "input": id
  74. }
  75. );
  76. return res;
  77. }
  78. async function GetCarrerS1Suzuki(token="") {
  79. var res = await apollo.query(
  80. `
  81. query {
  82. carrers(where: {category: "S1" business_partner:"2"})
  83. {
  84. id
  85. name
  86. start_regis
  87. until_regis
  88. name_description
  89. }
  90. }`,
  91. token
  92. );
  93. return res;
  94. }
  95. async function GetCarrerD3Suzuki(token="") {
  96. var res = await apollo.query(
  97. `
  98. query {
  99. carrers(where: {category: "D3" business_partner:"2"})
  100. {
  101. id
  102. name
  103. start_regis
  104. until_regis
  105. name_description
  106. }
  107. }`,
  108. token
  109. );
  110. return res;
  111. }
  112. async function GetCarrerSMASuzuki(token="") {
  113. var res = await apollo.query(
  114. `
  115. query {
  116. carrers(where: {category: "SMA" business_partner:"2"})
  117. {
  118. id
  119. name
  120. start_regis
  121. until_regis
  122. name_description
  123. }
  124. }`,
  125. token
  126. );
  127. return res;
  128. }
  129. module.exports = {
  130. //yamaha
  131. GetCarrerS1Yamaha:GetCarrerS1Yamaha,
  132. GetCarrerD3Yamaha:GetCarrerD3Yamaha,
  133. GetCarrerSMAYamaha:GetCarrerSMAYamaha,
  134. //suzuki
  135. GetCarrerS1Suzuki:GetCarrerS1Suzuki,
  136. GetCarrerD3Suzuki:GetCarrerD3Suzuki,
  137. GetCarrerSMASuzuki:GetCarrerSMASuzuki,
  138. GetDetailCarrer:GetDetailCarrer,
  139. };