feature/get-places-api #2
27
src/driven/adapters/auth-admin-login/authAdminLogin.ts
Normal file
27
src/driven/adapters/auth-admin-login/authAdminLogin.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import { apiUrls } from '~/driven/utils/configs/appConfig';
|
||||||
|
import { HttpOptionsType } from '~/driven/boundaries/http-boundary/protocols';
|
||||||
|
import { HTTPPovider } from '~/driven/boundaries/http-boundary/httpBoundary';
|
||||||
|
import { IOtpAuthDrivenPort } from '~/business-logic/generic/admin-user/authentication/otp-auth/port';
|
||||||
|
import { OtpAuthResponse } from '~/business-logic/generic/admin-user/authentication/otp-auth/data/reponse-object/otpAuthRO';
|
||||||
|
import { OtpAuthDTOReturnType } from '~/business-logic/generic/admin-user/authentication/otp-auth/data/dto/otpAuthDto';
|
||||||
|
|
||||||
|
const authAdminLogin = (): IOtpAuthDrivenPort => {
|
||||||
|
const httpProvider = new HTTPPovider();
|
||||||
|
const httpHandler = (data: OtpAuthDTOReturnType): Promise<OtpAuthResponse> => {
|
||||||
|
const url = apiUrls.generic.authLogin;
|
||||||
|
const options: HttpOptionsType = {
|
||||||
|
url,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
data,
|
||||||
|
};
|
||||||
|
return httpProvider.request<OtpAuthResponse>(options);
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
httpHandler,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
export default authAdminLogin;
|
Loading…
x
Reference in New Issue
Block a user