Update logging
This commit is contained in:
parent
def602c05e
commit
810a333429
39 changed files with 85 additions and 139 deletions
|
|
@ -15,8 +15,8 @@ export const POST = async (req: NextRequest) => {
|
|||
rejectUnauthorized: false,
|
||||
},
|
||||
headers: {
|
||||
authorization
|
||||
}
|
||||
authorization,
|
||||
},
|
||||
});
|
||||
|
||||
const succeeded = [];
|
||||
|
|
@ -28,11 +28,15 @@ export const POST = async (req: NextRequest) => {
|
|||
const country = ticket.country[0] ?? "none";
|
||||
// @ts-expect-error
|
||||
const translatedCountry = taxonomy.country[country]?.display ?? "none";
|
||||
const countryDetails: any = unRegions.find((c) => c.name === translatedCountry);
|
||||
const countryDetails: any = unRegions.find(
|
||||
(c) => c.name === translatedCountry,
|
||||
);
|
||||
const augmentedTicket = {
|
||||
...ticket,
|
||||
region: countryDetails['sub-region']?.toLowerCase().replace(" ", "-") ?? null,
|
||||
continent: countryDetails.region?.toLowerCase().replace(" ", "-") ?? null,
|
||||
region:
|
||||
countryDetails["sub-region"]?.toLowerCase().replace(" ", "-") ?? null,
|
||||
continent:
|
||||
countryDetails.region?.toLowerCase().replace(" ", "-") ?? null,
|
||||
};
|
||||
const out = await client.create({
|
||||
id: uuid(),
|
||||
|
|
@ -40,10 +44,9 @@ export const POST = async (req: NextRequest) => {
|
|||
refresh: true,
|
||||
body: augmentedTicket,
|
||||
});
|
||||
console.log(out);
|
||||
succeeded.push(id);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
console.error(e);
|
||||
failed.push(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -52,4 +55,3 @@ export const POST = async (req: NextRequest) => {
|
|||
|
||||
return NextResponse.json(results);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue