{{={= =}=}} import { api, handleApiError } from 'wasp/client/api'; import { initSession } from '../../helpers/user'; import { SessionResponseSchema } from '../../responseSchemas'; // PUBLIC API export async function login(data: { email: string; password: string }): Promise { try { const { sessionId } = await api.post('{= loginPath =}', { json: data, }).json(SessionResponseSchema); await initSession(sessionId); } catch (e) { throw handleApiError(e); } }