chore: fix styles and change the apis

This commit is contained in:
Koosha Lahouti
2025-08-15 17:49:53 +03:30
parent f82fed54d5
commit fa2d2a3c73
15 changed files with 1218 additions and 1190 deletions

View File

@@ -1,36 +1,12 @@
import {
type SendEmailOtpPayload,
type TokenApiResponse,
type ConfirmEmailOtpPayload,
type CompleteUserInfoPayload,
type CompleteUserInfoResponse,
type GenericApiResponse,
} from './types';
import axios from 'axios';
} from '../types/completionFormApiTypes';
import apiClient from '@/lib/apiClient';
const AUTH_API_URL = 'https://accounts.business-harmony.com';
export const getTokenApi = async (): Promise<TokenApiResponse> => {
const body = new URLSearchParams();
body.set('grant_type', 'password');
body.set('username', 'zareian.1381@gmail.com');
body.set('password', '123@Qweasd');
body.set('client_id', 'harmony_identity');
body.set('scope', 'openid harmony_identity profile offline_access');
const { data } = await axios.post<TokenApiResponse>(
`${AUTH_API_URL}/connect/token`,
body.toString(),
{
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
},
);
return data;
};
export const sendEmailOtpApi = async (
payload: SendEmailOtpPayload,
): Promise<GenericApiResponse & { codeSentAnyway?: boolean }> => {