You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 line
3.0KB

  1. import { APICommonResponse, ApiId, HttpMethod, makeParam, request } from "api";
  2. import { getUrl } from "./url";
  3. export type 顧客ログインユーザ = {
  4. id: string;
  5. name: string;
  6. email: string;
  7. customer_code: string;
  8. customer_name: string;
  9. };
  10. export type 店舗ログインユーザ = {
  11. id: string;
  12. name: string;
  13. email: string;
  14. shop_id: string;
  15. shop_name: string;
  16. };
  17. // -------顧客ログインユーザ新規登録---------------
  18. export type 顧客ログインユーザ新規登録Request = {
  19. name: string;
  20. email: string;
  21. password: string;
  22. customer_code: string;
  23. };
  24. export type 顧客ログインユーザ新規登録Response = {
  25. data: {
  26. user_id: string;
  27. };
  28. } & APICommonResponse;
  29. export const 顧客ログインユーザ新規登録 = async (
  30. param: 顧客ログインユーザ新規登録Request
  31. ) => {
  32. const res = await request<顧客ログインユーザ新規登録Response>({
  33. url: getUrl(ApiId.顧客ログインユーザ新規登録),
  34. method: HttpMethod.POST,
  35. data: makeParam(param),
  36. });
  37. return res;
  38. };
  39. // -------店舗ログインユーザ新規登録---------------
  40. export type 店舗ログインユーザ新規登録Request = {
  41. shop_id: string;
  42. name: string;
  43. email: string;
  44. password: string;
  45. };
  46. export type 店舗ログインユーザ新規登録Response = {
  47. data: {
  48. user_id: string;
  49. };
  50. } & APICommonResponse;
  51. export const 店舗ログインユーザ新規登録 = async (
  52. param: 店舗ログインユーザ新規登録Request
  53. ) => {
  54. const res = await request<店舗ログインユーザ新規登録Response>({
  55. url: getUrl(ApiId.店舗ログインユーザ新規登録),
  56. method: HttpMethod.POST,
  57. data: makeParam(param),
  58. });
  59. return res;
  60. };
  61. // -------顧客ログインユーザ一覧取得---------------
  62. export type 顧客ログインユーザ一覧取得Request = {
  63. email?: string;
  64. name?: string;
  65. };
  66. export type 顧客ログインユーザ一覧取得Response = {
  67. data: {
  68. list: 顧客ログインユーザ[];
  69. };
  70. } & APICommonResponse;
  71. export const 顧客ログインユーザ一覧取得 = async (
  72. param: 顧客ログインユーザ一覧取得Request
  73. ) => {
  74. const res = await request<顧客ログインユーザ一覧取得Response>({
  75. url: getUrl(ApiId.顧客ログインユーザ一覧取得),
  76. method: HttpMethod.GET,
  77. data: new URLSearchParams(param),
  78. });
  79. return res;
  80. };
  81. // -------店舗ログインユーザ一覧取得---------------
  82. export type 店舗ログインユーザ一覧取得Request = {
  83. email?: string;
  84. name?: string;
  85. };
  86. export type 店舗ログインユーザ一覧取得Response = {
  87. data: {
  88. list: 店舗ログインユーザ[];
  89. };
  90. } & APICommonResponse;
  91. export const 店舗ログインユーザ一覧取得 = async (
  92. param: 店舗ログインユーザ一覧取得Request
  93. ) => {
  94. const res = await request<店舗ログインユーザ一覧取得Response>({
  95. url: getUrl(ApiId.店舗ログインユーザ一覧取得),
  96. method: HttpMethod.GET,
  97. data: new URLSearchParams(param),
  98. });
  99. return res;
  100. };