|
- import { APICommonResponse, ApiId, HttpMethod, makeParam, request } from "api";
- import { getUrl } from "./url";
-
- export type 顧客ログインユーザ = {
- id: string;
- name: string;
- email: string;
- customer_code: string;
- customer_name: string;
- };
-
- export type 店舗ログインユーザ = {
- id: string;
- name: string;
- email: string;
- shop_id: string;
- shop_name: string;
- };
-
- // -------顧客ログインユーザ新規登録---------------
- export type 顧客ログインユーザ新規登録Request = {
- name: string;
- email: string;
- password: string;
- customer_code: string;
- };
- export type 顧客ログインユーザ新規登録Response = {
- data: {
- user_id: string;
- };
- } & APICommonResponse;
- export const 顧客ログインユーザ新規登録 = async (
- param: 顧客ログインユーザ新規登録Request
- ) => {
- const res = await request<顧客ログインユーザ新規登録Response>({
- url: getUrl(ApiId.顧客ログインユーザ新規登録),
- method: HttpMethod.POST,
- data: makeParam(param),
- });
- return res;
- };
-
- // -------店舗ログインユーザ新規登録---------------
- export type 店舗ログインユーザ新規登録Request = {
- shop_id: string;
- name: string;
- email: string;
- password: string;
- };
- export type 店舗ログインユーザ新規登録Response = {
- data: {
- user_id: string;
- };
- } & APICommonResponse;
- export const 店舗ログインユーザ新規登録 = async (
- param: 店舗ログインユーザ新規登録Request
- ) => {
- const res = await request<店舗ログインユーザ新規登録Response>({
- url: getUrl(ApiId.店舗ログインユーザ新規登録),
- method: HttpMethod.POST,
- data: makeParam(param),
- });
- return res;
- };
-
- // -------顧客ログインユーザ一覧取得---------------
- export type 顧客ログインユーザ一覧取得Request = {
- email?: string;
- name?: string;
- };
- export type 顧客ログインユーザ一覧取得Response = {
- data: {
- list: 顧客ログインユーザ[];
- };
- } & APICommonResponse;
- export const 顧客ログインユーザ一覧取得 = async (
- param: 顧客ログインユーザ一覧取得Request
- ) => {
- const res = await request<顧客ログインユーザ一覧取得Response>({
- url: getUrl(ApiId.顧客ログインユーザ一覧取得),
- method: HttpMethod.GET,
- data: new URLSearchParams(param),
- });
- return res;
- };
-
- // -------店舗ログインユーザ一覧取得---------------
- export type 店舗ログインユーザ一覧取得Request = {
- email?: string;
- name?: string;
- };
- export type 店舗ログインユーザ一覧取得Response = {
- data: {
- list: 店舗ログインユーザ[];
- };
- } & APICommonResponse;
- export const 店舗ログインユーザ一覧取得 = async (
- param: 店舗ログインユーザ一覧取得Request
- ) => {
- const res = await request<店舗ログインユーザ一覧取得Response>({
- url: getUrl(ApiId.店舗ログインユーザ一覧取得),
- method: HttpMethod.GET,
- data: new URLSearchParams(param),
- });
- return res;
- };
|