Skip to content
Open
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,15 @@ const getSeedsFromS3 = async (s3Location: { s3Bucket?: string; s3Key?: string; s
})
.promise();

if (!body) {
throw new Error(`Cannot load seeds from bucket ${s3Bucket} with key ${s3Key}`);
const bodyContents = await body.transformToString("utf-8");

if (!bodyContents) {
throw new Error(
`Cannot load seeds from bucket ${s3Bucket} with key ${s3Key}`
);
}

return JSON.parse(body.toString()) as Seeds;
return JSON.parse(bodyContents) as Seeds;
};

const writeSeeds = async (tableName: string, seeds: Seeds): Promise<void> => {
Expand Down