Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
…de-server into feature/hanoak
  • Loading branch information
hanoak20 committed Feb 1, 2024
commit 095b866c4870a09d130442bc982b4fc45f80c80f
19 changes: 9 additions & 10 deletions src/services/contentMapper.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ const getExistingContentTypes = async (req: Request) => {
token_payload?.region,
token_payload?.user_id
);
const project = await ProjectModel.findById(projectId)
const stackId = project?.migration?.modules?.destination_cms?.stack_id
const project = await ProjectModel.findById(projectId);
const stackId = project?.migration?.modules?.destination_cms?.stack_id;
const [err, res] = await safePromise(
https({
method: "GET",
Expand All @@ -182,7 +182,7 @@ const getExistingContentTypes = async (req: Request) => {
]!}/content_types`,
headers: {
api_key: stackId,
authtoken : authtoken
authtoken: authtoken,
},
})
);
Expand All @@ -193,14 +193,13 @@ const getExistingContentTypes = async (req: Request) => {
status: err.response.status,
};

const contentTypes = res.data.content_types.map((singleCT:any)=>{
const contentTypes = res.data.content_types.map((singleCT: any) => {
return {
title : singleCT.title,
uid : singleCT.uid,
schema : singleCT.schema
}
})

title: singleCT.title,
uid: singleCT.uid,
schema: singleCT.schema,
};
});

//Add logic to get Project from DB
return { contentTypes };
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.