feat: Update environment variable naming and refactor image URL handling across the application

This commit is contained in:
2024-11-26 10:34:29 +02:00
parent 29e8d3d133
commit b7771ac827
14 changed files with 107 additions and 69 deletions

View File

@@ -1174,7 +1174,7 @@ export const handler = async () => {
console.info(`Data population for table ${tableName} complete.`);
}
console.log("Data population complete.");
console.info("Data population complete.");
} catch (error) {
console.error("Failed to populate data:", error);
}

View File

@@ -10,10 +10,9 @@ const client = new DynamoDBClient({ region: SLS_REGION });
const docClient = DynamoDBDocument.from(client);
export const handler = async (event: any): Promise<any> => {
console.info(`Event: ${JSON.stringify(event)}`);
const username =
event.request.userAttributes["preferred_username"] || event.userName;
const cognitoId = event.userName;
const cognitoId = event.request.userAttributes["sub"];
const teamId = await fetchRandomTeamId();
try {

View File

@@ -17,13 +17,17 @@ export const handler = async (event: any): Promise<any> => {
const userTasks = [...authorTasks, ...assigneeTasks];
const uniqueTasks = Array.from(
new Map(userTasks.map((task) => [task.taskId, task])).values()
);
return {
statusCode: 200,
headers: {
"Content-Type": "application/json",
"Access-Control-Allow-Origin": "*",
},
body: JSON.stringify(userTasks),
body: JSON.stringify(uniqueTasks),
};
} catch (error: any) {
return {