Skip to content

Commit

Permalink
fix deprecated faker call
Browse files Browse the repository at this point in the history
  • Loading branch information
thooyork committed Jun 12, 2024
1 parent 2592fa2 commit ec1f3eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/src/service/testdata-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export async function createRandomAttachment(post: PostEntity, seed?: number): P
const data = await generateRandomPng(faker.datatype.number());
const file: FileEntity = await FileEntity.fromData(await data.arrayBuffer());
await AppDataSource.manager.createQueryBuilder().insert().into(FileEntity).values(file).onConflict('("sha256") DO NOTHING').execute();
const attachment: AttachmentEntity = { post, file, filename: faker.random.word() + ".png" };
const attachment: AttachmentEntity = { post, file, filename: faker.lorem.word() + ".png" };
await AppDataSource.manager.getRepository(AttachmentEntity).insert(attachment);
return attachment;
} catch (e) {
Expand Down

0 comments on commit ec1f3eb

Please sign in to comment.