feature/get-places-api #2

Merged
behnam merged 26 commits from feature/get-places-api into develop 2023-05-23 09:23:56 +00:00
Showing only changes of commit 6ccf3ee25b - Show all commits

View File

@ -0,0 +1,29 @@
import { CreateProfileDtoReturnType } from '~/business-logic/core/users/create-user/create-profile/data/dto/protocols';
import createUserPort from '~/business-logic/core/users/create-user/ports';
import { HTTPPovider } from '~/driven/boundaries/http-boundary/httpBoundary';
import { HttpOptionsType } from '~/driven/boundaries/http-boundary/protocols';
import { apiUrls } from '~/driven/utils/configs/appConfig';
const createProfileAdapter = (): createUserPort['httpProfileHandler'] => {
// make url
const url = apiUrls.core.createUserProfile;
// call http provider
const httpProvider = new HTTPPovider();
const httpHandler = (newAccountData: CreateProfileDtoReturnType) => {
// api options
const httpOptions: HttpOptionsType = {
url,
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: newAccountData,
};
return httpProvider.request<string>(httpOptions);
};
return httpHandler;
};
export default createProfileAdapter;