Skip to content

Commit

Permalink
rm commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffanyvu committed Nov 28, 2024
1 parent 333a867 commit c877258
Showing 1 changed file with 1 addition and 38 deletions.
39 changes: 1 addition & 38 deletions lib/lambda/sinkChangelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const processAndIndex = async ({
const result = schema.safeParse(record);

if (result.success) {
docs.push(result.data); // Use transformed data
docs.push(result.data);
} else {
console.log(
`Skipping package with invalid format for type "${record.adminChangeType}"`,
Expand All @@ -123,43 +123,6 @@ const processAndIndex = async ({
console.log(`Unknown adminChangeType: ${record.adminChangeType}`);
}

// if (record.isAdminChange) {
// if (record.adminChangeType === "delete") {
// const deletedPackageSchema = z.object({
// id: z.string(),
// deleted: z.boolean(),
// });

// transformedData = deletedPackageSchema.transform((schema) => ({
// ...schema,
// event: "soft-delete",
// packageId: schema.id,
// id: `${schema.id}-${offset}`,
// timestamp: Date.now(),
// }));

// const result = transformedData.safeParse(record);

// if (result.success) {
// docs.push(result.data);
// } else {
// console.log("Skipping package with invalid format", result.error.message);
// }
// }

// if (record.adminChangeType === "update-values") {
// transformedData = {
// ...record,
// event: "update-values",
// packageId: record.id,
// id: `${record.id}-${offset}`,
// timestamp: Date.now(),
// };

// docs.push(transformedData);
// }
// }

// If we're not a mako event, continue
// TODO: handle legacy. for now, just continue
if (!record.event || record?.origin !== "mako") {
Expand Down

0 comments on commit c877258

Please sign in to comment.