export type Model72 = {email: string, password: string, deviceType: 'WEB' | 'ANDROID' | 'IOS', role: 'smrUser'}; export type CreateApiShareMyRideLoginArgs = {body: Model72}; export type CreateApiShareMyRideLoginOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Login share my ride user * * POST /share-my-ride/login */ export const createApiShareMyRideLogin = async (args: CreateApiShareMyRideLoginArgs, options?: CreateApiShareMyRideLoginOptions) => { const {baseUrl = "http://api.pickerexpress.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/share-my-ride/login${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };